469,587 Members | 2,700 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,587 developers. It's quick & easy.

CSS not rendering in dynamic areas of an HTML page - IE only

This is sort of a design/javascript question. It involves CSS
rendering in dynamic areas of a page using IE.

E 6 & 7

HI There, We've created some example static html pages (using CSS)
that look great in IE. We are now converting these into dynamic pages
that use javascript to dynamically update certain areas of the page.
After the conversion the dynamic areas of the page do not render the
CSS styles (the styles are not displaying correctly). This only
happens in IE. The styles display correctly for other browsers
(firefox).

I am using the javascript DOM to update the dynamic areas of the site.
For example when creating a <atag that needs attribute
class=over....I add the following code.

linktag = document.createElement("a");
linktag.setAttribute("href",pathName);
linktag.setAttribute("class","over");

it's the class=over that is not rendering when the page is updated.
Has anyone seen this?

Thanks,

Brian

Dec 21 '06 #1
3 1787
br**********@gmail.com wrote:
This only happens in IE.
linktag.setAttribute("class","over");
Internet Explorer has a very broken implementation of setAttribute.
Use .className instead.

--
David Dorward <http://blog.dorward.me.uk/ <http://dorward.me.uk/>
Home is where the ~/.bashrc is
Dec 21 '06 #2
br**********@gmail.com wrote:
>
linktag = document.createElement("a");
linktag.setAttribute("href",pathName);
linktag.setAttribute("class","over");

it's the class=over that is not rendering when the page is updated.
Has anyone seen this?
I believe you need to use 'className' ('class' is, I think, a reserved
word) ie.

linktag.className = "over";
Andrew Poulos
Dec 21 '06 #3
thanks!!! That worked!

Andrew Poulos wrote:
br**********@gmail.com wrote:

linktag = document.createElement("a");
linktag.setAttribute("href",pathName);
linktag.setAttribute("class","over");

it's the class=over that is not rendering when the page is updated.
Has anyone seen this?
I believe you need to use 'className' ('class' is, I think, a reserved
word) ie.

linktag.className = "over";
Andrew Poulos
Dec 22 '06 #4

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

30 posts views Thread by Matt Probert | last post: by
6 posts views Thread by Adam Smith | last post: by
10 posts views Thread by Jason Pettys | last post: by
5 posts views Thread by Dave A | last post: by
2 posts views Thread by Giedrius | last post: by
7 posts views Thread by dino d. | last post: by
reply views Thread by suresh191 | last post: by
4 posts views Thread by guiromero | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.