The Expert Is WRONG about FRAME/Obj/Img

Discussion in 'Javascript' started by QA, Sep 11, 2004.

  1. QA

    QA Guest

    http://www.quirksmode.org/js/iframe.html
    says
    document.getElementById('testiframe').src
    and
    frames['testiframe'].location.href
    work for all

    The exper is WRONG. here is my test:

    //document.images['test'].src//workall
    //document.getElementById('test').src//notworking in firefox/opera
    //frames['test'].location.href//notworking in opera

    so all browers can detect document.images
    only IE can use getElementById
    only IE and Firefox can only frames.

    How is your testing case going? I am using IE6.0 Firefox 9.3 and Opera 7.45

    Any idea of any UNIVERSAL OBJECT system in HTML
     
    QA, Sep 11, 2004
    #1
    1. Advertising

  2. QA

    Jim Ley Guest

    On Sat, 11 Sep 2004 05:17:37 GMT, "QA" <> wrote:

    >http://www.quirksmode.org/js/iframe.html


    >The exper is WRONG. here is my test:
    >
    > //document.images['test'].src//workall
    > //document.getElementById('test').src//notworking in firefox/opera
    > //frames['test'].location.href//notworking in opera


    This isn't a testcase, you're not showing the relevant HTML code. In
    fact I would almost certainly say you're doing

    <img name= ...

    as that would do exactualy what you describe, the problems you're
    highlighting are differences in how name and ID are treated in those
    UA's so the HTML is completely relevant.

    >Any idea of any UNIVERSAL OBJECT system in HTML


    I've no idea what a universal object, even when shouted is?

    Jim.
     
    Jim Ley, Sep 11, 2004
    #2
    1. Advertising

  3. QA

    QA Guest

    > >http://www.quirksmode.org/js/iframe.html
    >
    > >The exper is WRONG. here is my test:
    > >
    > > //document.images['test'].src//workall
    > > //document.getElementById('test').src//notworking in firefox/opera
    > > //frames['test'].location.href//notworking in opera

    >
    > This isn't a testcase, you're not showing the relevant HTML code. In
    > fact I would almost certainly say you're doing
    >
    > <img name= ...
    >
    > as that would do exactualy what you describe, the problems you're
    > highlighting are differences in how name and ID are treated in those
    > UA's so the HTML is completely relevant.
    >
    > >Any idea of any UNIVERSAL OBJECT system in HTML

    >
    > I've no idea what a universal object, even when shouted is?
    >
    > Jim.


    you are so smart. I found the error myself. So getElementById is still THE
    KING, working in all, when I use ID.
    do you have any idea why http://www.quirksmode.org/js/iframe.html said ok
    frames['test'].location.href for opera but mine is not working? even i
    changed it to ID....
     
    QA, Sep 11, 2004
    #3
  4. QA wrote:


    > do you have any idea why http://www.quirksmode.org/js/iframe.html said ok
    > frames['test'].location.href for opera but mine is not working? even i
    > changed it to ID....


    If you have
    <iframe name="iframeName" src="whatever.html"></iframe>
    then
    window.frames.iframeName.location.href = 'whatelse.html';
    is giving the best cross browser results to change the document in the
    iframe.


    --

    Martin Honnen
    http://JavaScript.FAQTs.com/
     
    Martin Honnen, Sep 11, 2004
    #4
  5. QA

    Randy Webb Guest

    QA wrote:

    > So getElementById is still THE KING, working in all, when I use ID.


    Only because your test browsers support getElementById and the HTML you
    are using.

    --
    Randy
    comp.lang.javascript FAQ - http://jibbering.com/faq
     
    Randy Webb, Sep 11, 2004
    #5
    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. Mark Kamoski
    Replies:
    3
    Views:
    15,837
    Jay B. Harlow [MVP - Outlook]
    Aug 9, 2003
  2. JJ

    Expert Opinions - Doc Obj

    JJ, Feb 7, 2006, in forum: ASP .Net
    Replies:
    1
    Views:
    389
    Kevin Spencer
    Feb 7, 2006
  3. Phil Endecott

    Obj* ptr = new Obj(X)

    Phil Endecott, Jun 3, 2005, in forum: C++
    Replies:
    5
    Views:
    485
    Mark P
    Jun 3, 2005
  4. Shalabh Chaturvedi
    Replies:
    2
    Views:
    460
    Mike C. Fletcher
    Feb 20, 2004
  5. Matthew Thorley

    How do you convert a string obj to a file obj?

    Matthew Thorley, May 4, 2005, in forum: Python
    Replies:
    7
    Views:
    525
    Peter Otten
    May 4, 2005
Loading...

Share This Page