PDA

View Full Version : insert content (javascript and texts) with CSS?



Radscientist
Jul 22nd, 2010, 05:05 PM
insert content (javascript and texts) with CSS?

I'm particularly interested in this because it may make it much much easier to keep the entire site kept up to date as much as possible. this way, I can concentrate only on the content instead of the links and the like.

Basically, is it possible to inject javascript (an posterous RSS feed box) and some texts (list of links (navigation)) all through CSS?

VIPStephan
Jul 22nd, 2010, 05:39 PM
No, CSS is there to style content that exists, not insert non-existing content. For website content management there are so called content management systems (CMS). You can also generate content with JavaScript but as it’s happening on the cliet side (i. e. in the browser) it’s not 100% reliable since the user can do with their browser whatever they want (e. g. switch of JavaScript or whatever).

Radscientist
Jul 22nd, 2010, 10:14 PM
hmmm.... okay, so what would be the safest way to have a RSS feed list of my posterous blog on the right column of my site?

I had thought that it was possible to inject SOME content/HTML via CSS thanks to these links...
http://www.w3schools.com/Css/pr_gen_content.asp
http://neilobremski.wordpress.com/2009/10/31/css-insert-content/

being able to do that would allow me to trim down on the main HTML page itself and keep it less cluttered for the main content that would be updated more often. It would make it much easier to just change a link in the navigation in the CSS once instead of having to do it on every single pages.

P.S.
click on the bottom link in my site to see the current layout that I'm considering so far.

VIPStephan
Jul 23rd, 2010, 02:29 AM
To dynamically generate/add/remove/update content on your website you would use (unobtrusive (http://en.wikipedia.org/wiki/Unobtrusive_JavaScript)) JavaScript, probably in combination with some PHP. But I wouldn’t know from mind how to do that so I did a quick search for you and look what came up: http://www.google.com/search?q=display+RSS+feed+on+website