By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
437,712 Members | 2,111 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 437,712 IT Pros & Developers. It's quick & easy.

Opening URL in frame

P: n/a
Hi there

Could someone please help, I have very little grasp of javascript, I have
tried but cannot get either of the two things I want to do together to
work.

I have a webpage with frame with nav buttons - Next and Prev - at the
bottom whilst the top frame hs a URL from a search engine along the lines
of page1search.htm. What I want to do is to press Next and it call a
function to change the top frame to page2search.htm but despite trying for
some time I can't get my head round how to do it!

My variables don't seem to add the pages on - var num=0 outside the
function and then num=num+1 each time its called added into the string as
"page"+num+"search.htm", that is correct?

And I also am having problems trying to open the page in the top frame, it
doesn't seem to no mater what method I use!

Could someone please point me in right direction??

Many thanks

Paul
Jul 20 '05 #1
Share this Question
Share on Google+
2 Replies


P: n/a
@SM
Paul Delaney a ecrit :
Hi there

Could someone please help, I have very little grasp of javascript, I have
tried but cannot get either of the two things I want to do together to
work.

I have a webpage with frame with nav buttons - Next and Prev - at the
bottom whilst the top frame hs a URL from a search engine along the lines
of page1search.htm. What I want to do is to press Next and it call a
function to change the top frame to page2search.htm but despite trying for
some time I can't get my head round how to do it!
so you have a page with at least 2 frames
in the html code you can name this frames
<frame blabla name="search" >
<frame blabla name="menu" >
<frame blabla name="main" >

any need of JavaScript !

in the page "menu.htm" loaded in frame "menu"

<a href="page2search.htm" target="search"><img
src="button_next.jpg" border=0></a>
in JS
<a href="javascript:parent.search.location='page2sear ch.htm';"
My variables don't seem to add the pages on - var num=0 outside the
function and then num=num+1 each time its called added into the string as
"page"+num+"search.htm", that is correct?


var num=0;
function gopage(sens){
num=num+sens*1;
if(num>0)
parent.search.location='page'+num+'search.htm';
else
parent.search.location='page0search.htm';
}

<a href="javascript:gopage(1);">Next</a>
<a href="javascript:gopage(-1);">Previous</a>
--
************************************************** ************
Stéphane MORIAUX : mailto:st*********************@wanadoo.fr
Aide aux Pages Perso (images & couleurs, formulaire, CHP, JS)
http://perso.wanadoo.fr/stephanePOINTmoriaux/internet/
************************************************** ************
Jul 20 '05 #2

P: n/a
"@SM" <st**************@wanadoo.fr> wrote in
news:3F***************@wanadoo.fr:

[SNIP]
var num=0;
function gopage(sens){
num=num+sens*1;
if(num>0)
parent.search.location='page'+num+'search.htm';
else
parent.search.location='page0search.htm';
}

<a href="javascript:gopage(1);">Next</a>
<a href="javascript:gopage(-1);">Previous</a>


Thanks, that works perfectly, much appreciated and Merry Christmas!

Paul

Jul 20 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.