Click to See Complete Forum and Search --> : jump page in history when going to .pdf file


nikr
08-19-2003, 07:47 AM
Hi, when using location.replace(url) on my jump page, the jump page does not go into the history unless it is a .pdf file. We are getting complaints from users because they have to hit the back button twice to get back to the original page, or people complain that they are in a loop (hit the back button once, then get redirected to the .pdf).

Below is my code... Any suggestions on how to get around this??

Thanks in advance..
Nik

------------------------

jump page code:
<html>
<head>
</head>
<body>

<SCRIPT LANGUAGE="JavaScript">
<!--
if (document.images)
{
location.replace('http://www.globalspec.com/MediaKit/PeakToPeak_July03.pdf');
}
//-->
</SCRIPT>
</body>
</html>

Khalid Ali
08-19-2003, 10:38 AM
window.location.replace()

will replace this page in the history therefore if you try to go to go(-1) you will be sent back to this pagethe new url that replaced the previous one


if there is no specific reason to use replace...

use
location.href=url

nikr
08-19-2003, 10:44 AM
neither window.location.replace() or location.href=url work.

loction.replace() works only when you are not going to a .pdf file. If you go to a .pdf file, the jump page gets put in the history... If it is a normal web page, the jump page does not get put in the history.

Any other suggestions?