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

Discussion in 'Javascript' started by brian.turner@gmail.com, Dec 21, 2006.

  1. Guest

    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
    , Dec 21, 2006
    #1
    1. Advertising

  2. 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
    David Dorward, Dec 21, 2006
    #2
    1. Advertising

  3. 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
    Andrew Poulos, Dec 21, 2006
    #3
  4. Guest

    thanks!!! That worked!

    Andrew Poulos wrote:
    > 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, 2006
    #4
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Martin Marinov

    different validation areas in aspx page.

    Martin Marinov, Jul 8, 2004, in forum: ASP .Net
    Replies:
    3
    Views:
    791
    Alphonse Giambrone
    Jul 8, 2004
  2. =?Utf-8?B?RWFnbGVSZWRASGlnaEZseWluZ0JpcmRzLmNvbQ==

    Printing ASP.NET 2.0 Page Leaves Blank Areas

    =?Utf-8?B?RWFnbGVSZWRASGlnaEZseWluZ0JpcmRzLmNvbQ==, Aug 16, 2006, in forum: ASP .Net
    Replies:
    2
    Views:
    376
    =?Utf-8?B?RWFnbGVSZWRASGlnaEZseWluZ0JpcmRzLmNvbQ==
    Nov 10, 2006
  3. Kevin Frey
    Replies:
    0
    Views:
    463
    Kevin Frey
    Sep 19, 2006
  4. tshad
    Replies:
    2
    Views:
    579
    tshad
    Oct 27, 2009
  5. Replies:
    6
    Views:
    110
    Dr John Stockton
    Feb 7, 2006
Loading...

Share This Page