IE5 and document.createElement

Discussion in 'Javascript' started by Andrew Poulos, Dec 6, 2004.

  1. I'm having some trouble getting document.createElement to work with IE
    5. Is this because it's unsupported? And, if it is unsupported, is using
    innerHTML a valid workaround?

    Andrew Poulos
    Andrew Poulos, Dec 6, 2004
    #1
    1. Advertising

  2. Andrew Poulos

    Randy Webb Guest

    Randy Webb, Dec 6, 2004
    #2
    1. Advertising

  3. Randy Webb wrote:
    > Andrew Poulos wrote:
    >
    >> I'm having some trouble getting document.createElement to work with IE
    >> 5. Is this because it's unsupported? And, if it is unsupported, is
    >> using innerHTML a valid workaround?

    >
    > <URL:
    > http://msdn.microsoft.com/workshop/author/dhtml/reference/methods/createElement.asp
    > />
    >
    > Implies that it should work in IE5, but what code is not "working"?
    >

    I've tested it further and I think the problem is different from the one
    I first thought it was. Some thing like this doesn't work:

    <script type="text/javascript">
    window.onload = foo;
    </script>
    <body>

    whereas this does work:

    <script type="text/javascript">
    </script>
    <body onload="javascript:foo();">

    This is not the way I want to handle events. Is there something I can do
    to get the first way (event handlers?) to work in IE5?

    Andrew Poulos
    Andrew Poulos, Dec 6, 2004
    #3
    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. Tom
    Replies:
    0
    Views:
    1,029
  2. Weston C

    document.createElement('a') doesn't work?

    Weston C, Jan 9, 2004, in forum: Javascript
    Replies:
    4
    Views:
    109
    Michael Hill
    Jan 9, 2004
  3. Pieter Van Waeyenberge

    'wrap' inconsistency? createElement VS document.write

    Pieter Van Waeyenberge, Feb 9, 2004, in forum: Javascript
    Replies:
    3
    Views:
    178
    Pieter Van Waeyenberge
    Feb 11, 2004
  4. Replies:
    7
    Views:
    90
    Thomas 'PointedEars' Lahn
    May 16, 2006
  5. James Black
    Replies:
    10
    Views:
    280
    Thomas 'PointedEars' Lahn
    May 25, 2006
Loading...

Share This Page