...

View Full Version : NS7 doesn't support....



suisui
07-11-2002, 06:22 AM
Hi, I have facing some problem and found that NS7 doesn't support javascript:history.back() or javascript:history.go(-2)
:(
anyone can help me to solve it?
many thanks.

premshree
07-11-2002, 02:00 PM
Hello,

Well, I tested it on NS7 and it does work :


<script>
document.write('<a href="#" onclick="history.go(-2)">Click</a>');
</script>


Well, if there is no page in the history, that's another thing :)

:thumbsup:

jkd
07-11-2002, 07:23 PM
Also, please refrain from pm-ing mods (ahem, me) for questions that can be asked in the forum. I read the forums too you know.

suisui
07-12-2002, 06:03 AM
premshree,
no...
It doesn't work....
why?

jkd
07-12-2002, 06:07 AM
history.back()

and

history.go(-1)

both work fine in all builds off the Mozilla 1.0 trunk. (Not to mention every single build of Gecko in existance - from what I can quickly tell in BugZilla).

It is something *else* you are doing, care to post some code?

suisui
07-12-2002, 08:06 AM
Okay, here are the code:

page 1

<html>
<head>
<title>Untitled Document</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>

<body bgcolor="#FFFFFF" text="#000000">
<a href="his_back.htm">link</a>
</body>
</html>

---------------------------------------------------
page 2

<HTML>
<HEAD>
<TITLE> New Document </TITLE>
<script>
document.write('<a href="#" onclick="history.go(-2)">Click</a>');
</script>
<BODY>


</BODY>
</HTML>

thanks for helping :)

glenngv
07-12-2002, 08:13 AM
you should have used history.go(-1), since you only need to go 1 (not 2) page back. Or simply history.back()


Originally posted by suisui
Okay, here are the code:

page 1

<html>
<head>
<title>Untitled Document</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>

<body bgcolor="#FFFFFF" text="#000000">
<a href="his_back.htm">link</a>
</body>
</html>

---------------------------------------------------
page 2

<HTML>
<HEAD>
<TITLE> New Document </TITLE>
<script>
document.write('<a href="#" onclick="history.go(-2)">Click</a>');
</script>
<BODY>


</BODY>
</HTML>

thanks for helping :)

suisui
07-12-2002, 08:21 AM
no...
it doesn't work :(

glenngv
07-12-2002, 08:27 AM
ok, i saw what you were doing wrong. put the script inside the body tag. Anchor tag should be inside the body. And also you did not have the </head> tag.

page 2

<HTML>
<HEAD>
<TITLE> New Document </TITLE>
</HEAD>
<BODY>
<script>
document.write('<a href="#" onclick="history.go(-1)">Click</a>');
</script>
</BODY>
</HTML>

suisui
07-12-2002, 10:50 AM
no....
it doesn't go back to history page too...
:(

glenngv
07-12-2002, 11:08 AM
did you copy & paste the code I made?
can you see the Back button enabled in the toolbar?
can you post the codes (again) you were executing.

suisui
07-15-2002, 05:28 AM
page 1

<html>
<head>
<title>Untitled Document</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>

<body bgcolor="#FFFFFF" text="#000000">
<a href="his_back.htm">link</a>
</body>
</html>
===============================

page 2

<HTML>
<HEAD>
<TITLE> New Document </TITLE>
</head>
<BODY>
<a href="javascript:history.back()">Back</a>
</BODY>
</HTML>


==============================
thanks for helping.

suisui

Cloudski
07-15-2002, 05:55 AM
Don't put the jabascript tag in there.... do what glenngv put like this

Page 2:

<HTML>
<HEAD>
<TITLE> New Document </TITLE>
</head>
<BODY>
<script>
document.write('<a href="#" onclick="history.back()">Back');
</script>
</BODY>
</HTML>

suisui
07-15-2002, 06:20 AM
I'm using Netscape 7.0 Preview Release 1, duno why ... still can't work with history.back()... :(

Cloudski
07-15-2002, 11:11 AM
I must really be out of it.. I forgot the </a>



<script>
document.write('<a href="#" onclick="history.back()">Back</a>');
</script>

glenngv
07-16-2002, 03:51 AM
can you see the Back button enabled in the toolbar while in page 2?


Originally posted by suisui
I'm using Netscape 7.0 Preview Release 1, duno why ... still can't work with history.back()... :(



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum