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

Frames:Controlling another frame w/ history.go(-1)

P: n/a
Hi,
I have a page that I am setting up at
http://www.extravaganzadesign.com/aw/frame.htm
I am using a frame on top for some navigation and the frame below for
content that will go to external sites. I want to be able to have
buttons in my first frame that function as "previous page" and "next
page" when applicable. I am trying to figure out the code to make this
work. Right now I have a function set up as:

<script type="text/javascript">
function goback()
{
window.parent.frames[1].history.go(-1);
}
</script>
And then my button I have set up as a null link with this code

<a href="#"= onClick="return goback()">

I am still obviously a JavaScript newbie (I am in my 4th week of my
JavaScript class) and would greatly appreciate any help.
Thanks

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


P: n/a
I removed the word "return" from my function call. Now it works in IE
but not NS or Safari. Any ideas still are appreciated!

Jenn wrote:
Hi,
I have a page that I am setting up at
http://www.extravaganzadesign.com/aw/frame.htm
I am using a frame on top for some navigation and the frame below for
content that will go to external sites. I want to be able to have
buttons in my first frame that function as "previous page" and "next
page" when applicable. I am trying to figure out the code to make this
work. Right now I have a function set up as:

<script type="text/javascript">
function goback()
{
window.parent.frames[1].history.go(-1);
}
</script>
And then my button I have set up as a null link with this code

<a href="#"= onClick="return goback()">

I am still obviously a JavaScript newbie (I am in my 4th week of my
JavaScript class) and would greatly appreciate any help.
Thanks


Jul 23 '05 #2

P: n/a
Jenn,
Remove the "return" from your function call. Also, there is an extra =
sign before your onclick that shouldn't be there.
Best Regards,
Your Alter Ego

Jenn wrote:
Hi,
I have a page that I am setting up at
http://www.extravaganzadesign.com/aw/frame.htm
I am using a frame on top for some navigation and the frame below for
content that will go to external sites. I want to be able to have
buttons in my first frame that function as "previous page" and "next
page" when applicable. I am trying to figure out the code to make this
work. Right now I have a function set up as:

<script type="text/javascript">
function goback()
{
window.parent.frames[1].history.go(-1);
}
</script>
And then my button I have set up as a null link with this code

<a href="#"= onClick="return goback()">

I am still obviously a JavaScript newbie (I am in my 4th week of my
JavaScript class) and would greatly appreciate any help.
Thanks


Jul 23 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.