Welcome to WebmasterWorld Guest from 54.159.19.75

Forum Moderators: open

Message Too Old, No Replies

Javascript to detect frames support

     
9:25 pm on May 7, 2003 (gmt 0)

Junior Member

10+ Year Member

joined:Apr 21, 2003
posts:63
votes: 0


How can I use javascript to detect frames? I want to run a small line of javascript, but only IF the browser supports FRAMES.

Any ideas?

Yamaha

[edited by: tedster at 9:29 pm (utc) on May 7, 2003]
[edit reason] change java to javascript [/edit]

9:43 pm on May 7, 2003 (gmt 0)

Senior Member

WebmasterWorld Senior Member 10+ Year Member

joined:Apr 18, 2003
posts:827
votes: 0


document.frames

But I don't know if it is defined if the document has no frames.

10:50 pm on May 7, 2003 (gmt 0)

Junior Member

10+ Year Member

joined:Apr 21, 2003
posts:63
votes: 0


Eureka!

I added:

if (top == self && document.frames) self.location.href =

And now it will only re-direct if the browser has frames.

Thanks!