Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Need page w/redirect to not be kept in history!

Status
Not open for further replies.

davidlieb

Instructor
Aug 26, 2004
4
0
0
US
I'm using a flash redirect which traps my users in my site because it won't let them use the back button.

I've heard that I can use window.location.replace to keep this from happening, but frankly, I'm new to JS, am using dreamweaver, and and having mucho problems.

Maybe someone can give me a tip?

Here's the script I'm using.

function MM_checkPlugin(plgIn, theURL, altURL, autoGo) { //v4.0
var ok=false; document.MM_returnValue = false;
with (navigator) if (appName.indexOf('Microsoft')==-1 || (plugins && plugins.length)) {
ok=(plugins && plugins[plgIn]);
} else if (appVersion.indexOf('3.1')==-1) { //not Netscape or Win3.1
if (plgIn.indexOf("Flash")!=-1 && window.MM_flash!=null) ok=window.MM_flash;
else if (plgIn.indexOf("Director")!=-1 && window.MM_dir!=null) ok=window.MM_dir;
else ok=autoGo; }
if (!ok) theURL=altURL; if (theURL) window.location=theURL;
}

and the body tag:
<body bgcolor="#000000" onLoad="MM_checkPlugin('Shockwave Flash','webdesignclass.html','no_flash_index.html',false);MM_preloadImages('video_training/images/order-now-sparkle-over.gif');return document.MM_returnValue">

Thanks!
 

I think that all you need to do is replace this:

Code:
window.location=theURL

with this:

Code:
location.replace(theURL);

Although I'm not quite sure what you mean when you say that you are using a "flash redirect".

I do not know about the browser compatibility of location.replace, as MSDN seems to imply it's an IE-only thing - although I thought it worked in other browsers too.

Hope this helps,
Dan
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top