Using document.load() to get html NOT xml document

Discussion in 'Javascript' started by icogs, Jan 31, 2008.

  1. icogs

    icogs Guest

    I wish to load an html document which may or may not be xhtml. I then
    wish to retrieve some elements using getElementsByTagName(). If I load
    the document into an <iframe> this works fine, however if I use
    document.load() then, even though the document is successfully
    retrieved, getElementsByTagName() returns nothing (yes I am using the
    correct case for the tag name). I suspect this is because it is being
    loaded as an xml document and, being html, this document will not be
    well formed. Is there a way to load as a regular html document? I
    would rather not use a hidden <iframe> if possible as I don't want to
    load embedded images etc.

    I am doing this from within a .xul document with Firefox BTW.
    icogs, Jan 31, 2008
    #1
    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. Tony Prichard
    Replies:
    0
    Views:
    716
    Tony Prichard
    Dec 12, 2003
  2. Manish Hatwalne
    Replies:
    1
    Views:
    392
    Martin Honnen
    Jul 13, 2004
  3. Replies:
    0
    Views:
    175
  4. Replies:
    2
    Views:
    128
  5. Duke
    Replies:
    1
    Views:
    151
    Tom de Neef
    Apr 18, 2008
Loading...

Share This Page