Velocity Reviews

Velocity Reviews (http://www.velocityreviews.com/forums/index.php)
-   Javascript (http://www.velocityreviews.com/forums/f68-javascript.html)
-   -   CSS not rendering in dynamic areas of an HTML page - IE only (http://www.velocityreviews.com/forums/t928846-css-not-rendering-in-dynamic-areas-of-an-html-page-ie-only.html)

brian.turner@gmail.com 12-21-2006 08:19 PM

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 <a> tag 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


David Dorward 12-21-2006 08:46 PM

Re: CSS not rendering in dynamic areas of an HTML page - IE only
 
brian.turner@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

Andrew Poulos 12-21-2006 10:54 PM

Re: CSS not rendering in dynamic areas of an HTML page - IE only
 
brian.turner@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

brian.turner@gmail.com 12-22-2006 06:57 PM

Re: CSS not rendering in dynamic areas of an HTML page - IE only
 
thanks!!! That worked!

Andrew Poulos wrote:
> brian.turner@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




All times are GMT. The time now is 01:32 AM.

Powered by vBulletin®. Copyright ©2000 - 2014, vBulletin Solutions, Inc.
SEO by vBSEO ©2010, Crawlability, Inc.