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 Postif document in frame2 is supposed to gain focus, why not
<body onload='self.focus();'>
in the document that is loading in frame 2in frame1
<body onload='parent.frame2.focus();'>
Jump to PostDoes that have any real meaning at all (for frames)? My guess was that an input needed focus.
you can apply focus to any element,
for this usage, focus is transferred to the body element within the frame, which of course fails(as expected) in any real sennse, leaving the frame …
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.