So, here's the picture: page1 has, at the bottom of it, a frame loading page2. The question is: can use a javascript (how?) in page2, so when the page1 loads, it will focus to the frame loading page2?
Thanks!
RobotFX
0
Junior Poster in Training
Recommended Answers
Jump to PostFrames don't have a focus. What exactly do you want to do? Also, do you really need a frame? Avoid them :)
Jump to PostYou can make an input field in the frame have focus:
document.getElementById('fieldid').focus()
Jump to PostChange document to frame.contentWindow.document, where frame is the frame your element is in.
Jump to PostSorry, didn't read carefully enough. You have to move your script to the head:
<html> <head> <script> window.onload = function() { document.getElementById('link').focus(); }; </script> </head> <body> <a id="link" href="http://xxx">xxx</a> </body> </html>
Edit: no, that's probably not what you mean. What was the goal of …
All 14 Replies
twiss
155
Veteran Poster
RobotFX
0
Junior Poster in Training
twiss
155
Veteran Poster
RobotFX
0
Junior Poster in Training
RobotFX
0
Junior Poster in Training
twiss
155
Veteran Poster
RobotFX
0
Junior Poster in Training
twiss
155
Veteran Poster
RobotFX
0
Junior Poster in Training
twiss
155
Veteran Poster
almostbob
866
Retired: passive income ROCKS
twiss
155
Veteran Poster
almostbob
866
Retired: passive income ROCKS
twiss
155
Veteran Poster
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.