/    Sign up×
Community /Pin to ProfileBookmark

Hi,
I’ve got a jump box on an html page, but I need it to change in the iframe, at the moment it opens over the top. The code is:-

<iframe src=”leishamniasis_2.htm” BORDER=”FALSE”
BANNER=”FALSE” WIDTH=”100%” HEIGHT=”500″>
</iframe>

<select name=”jumpit” onChange=”JumpTo(jumpit.options[jumpit.selectedIndex].value)”>

<option value=”leishamniasis_2.htm#Top” selected>Jump to…</option>

<option value=”leishamniasis_2.htm#pathogenesis”>
Pathogenesis</option>

</select>

I need the “leishamniasis_2.htm#pathogenesis” to jump down on the page, but within the i frame.

Cheers

to post a comment
Full-stack Developer

17 Comments(s)

Copy linkTweet thisAlerts:
@StefanFeb 06.2003 — Mayby you should include the script that you are refering to in the code?
Copy linkTweet thisAlerts:
@ashersauthorFeb 06.2003 — function JumpTo ( sOption ) {

navigate ( sOption );

Thanks
Copy linkTweet thisAlerts:
@CharlesFeb 06.2003 — [font=georgia]Your solution is to rid your self of all that JavaScript that isn't going to work all of the time no matter what you do.

Your IFRAME element should look like:

[font=monospace]

<iframe src="leishamniasis_2.htm" BORDER="FALSE"

BANNER="FALSE" WIDTH="100%" HEIGHT="500" name="child"><a href="leishamniasis_2.htm">leishamniasis_2.htm</a></iframe>

[/font]

You FORM tage should look like:

[font=monospace]

<form action="someScript.pl" target="child">

[/font]

You'll need to give your OPTION element a name, say "url". And your server side script should look something like:

[font=monospace]

#!usr/local/bin/perl

use CGI qw (redirect param);

print redirect 'http://www.somesite.com/'.param ('url');[/font][/font]
Copy linkTweet thisAlerts:
@khalidali63Feb 06.2003 — in your jumpTo(url) function do this.

document.iframeName.document.location.href =url;

This should do it.

cheers

Khalid
Copy linkTweet thisAlerts:
@ashersauthorFeb 06.2003 — What do you mean isnt going to work all the time?

I need it to work on the javascript I've got, not to change it.

Thanks
Copy linkTweet thisAlerts:
@CharlesFeb 06.2003 — [font=georgia]I might have mentioned this once or twice, but one in ten users do not use JavaScript - and that number includes people who cannot use JavaScript because of their disabilities.[/font]
Copy linkTweet thisAlerts:
@ashersauthorFeb 06.2003 — I will re-phrase my question then. How can I do this with the javascript I've got as I'm editing a huge site that already exits.
Copy linkTweet thisAlerts:
@ashersauthorFeb 06.2003 — Thanks khalidali63.

Where exactly should I put this, I'm a bit confussed - long day!

Cheers
Copy linkTweet thisAlerts:
@khalidali63Feb 06.2003 — I have posted a potential solution to ur problem above already.

Check it out.
Copy linkTweet thisAlerts:
@ashersauthorFeb 06.2003 — I have but cant get it to work.
Copy linkTweet thisAlerts:
@CharlesFeb 06.2003 — [i]Originally posted by khalidali63 [/i]

[B]in your jumpTo(url) function do this.



document.iframeName.document.location.href =url;



This should do it.



cheers



Khalid [/B]
[/QUOTE]
[font=georgia]For reasons I've explained elsewhere (http://forums.webdeveloper.com/showthread.php?s=&threadid=1517&highlight=document.location) [font=monospace]document.location.href[/font] is problematic. Use instead [font=monospace]Window.location.href[/font] or in this case use [font=monospace]document.iframeName.location.href[/font]. And if that fails, you might try my method.[/font]
Copy linkTweet thisAlerts:
@khalidali63Feb 06.2003 — If you look at this line of code (its fromyour first post)

<select name="jumpit" onChange="JumpTo(jumpit.options[jumpit.selectedIndex].value)">

onchange event has a method jumpto()

you are passing the currently selected value in the listbox to this jumpTo function.

Look for this function in the JavaScript code and put this line f code in it

document.ifrm.document.location.href =url;

Since you do not have a name attribute set for your iframe,therefore enter this value right after this

<iframe

name = "ifrm"

now your iframe tag should look like this

<iframe name="ifrm" src="leishamniasis_2.htm" BORDER="FALSE"

BANNER="FALSE" WIDTH="100%" HEIGHT="500">

</iframe>

If you are still confused then you might have post atleast your jumpTo function in its entirety here


hope this helps

Khalid
Copy linkTweet thisAlerts:
@ashersauthorFeb 06.2003 — Thanks, thats what I've been trying to do, I will play around with it more as I still cant get it to work.

This is my jumpto function in its entirety:-

function JumpTo ( sOption ) {

navigate ( sOption);

}

Cheers
Copy linkTweet thisAlerts:
@khalidali63Feb 06.2003 — ok now I see you have another function in there.

navigate()

..post that here
Copy linkTweet thisAlerts:
@ashersauthorFeb 06.2003 — Thats all there is does the same but links to the top of the page:-

<td width="8%" onclick="navigate('#Top');">

// Used for pulldown boxes to jump to a specific bookmark

function JumpTo ( sOption ) {

navigate ( sOption);
Copy linkTweet thisAlerts:
@khalidali63Feb 06.2003 — Since I do not have all of your code infront of me,i'll just say that for now comment

//navigate()

out and then put the his code in the jumpTo function


document.ifrm.document.location.href =sOption

your jumpTo function now should look like this

function jumpTo ( sOption ){

//navigate(Option)

document.ifrm.document.location.href =sOption

}
Copy linkTweet thisAlerts:
@ashersauthorFeb 06.2003 — Thanks

This works:-

function JumpTo ( sOption ) {

parent.frames[0].navigate ( sOption );
×

Success!

Help @ashers spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.6,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,

tipper: @Samric24,
tipped: article
amount: 1000 SATS,
)...