Opening URL in frame

P

Paul Delaney

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
 
@

@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='page2search.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:[email protected]
Aide aux Pages Perso (images & couleurs, formulaire, CHP, JS)
http://perso.wanadoo.fr/stephanePOINTmoriaux/internet/
**************************************************************
 
P

Paul Delaney

[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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,430
Messages
2,571,676
Members
48,796
Latest member
Greg L.

Latest Threads

Top