The Expert Is WRONG about FRAME/Obj/Img

Q

QA

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
 
J

Jim Ley

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.
 
Q

QA

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....
 
M

Martin Honnen

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.
 
R

Randy Webb

QA said:
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.
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,768
Messages
2,569,575
Members
45,053
Latest member
billing-software

Latest Threads

Top