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

Redirect Problem in IE

P: n/a
Ray
I have a function which accepts a page name and ID and redirects the
user to the specified page. The function works in Netscape and Firefox
but IE. The code I am using is;

function displayPage(page,id)
{
/*
alert("Page: "+page)
alert("ID: "+id)
*/

// Set the cookie so the truck page knows which truck to display...
expireDate = new Date;
document.cookie="Truck="+id+";expires="+expireDate ;

// Display the page...
window.location.href=page;
return false;
}

I have used various combinations of the location method including;
window.location=page;
window.location.href=page;
window.navigate=page;
document.location=page;
document.location.href=page;
location=page;
location.href=page;

Can anyone help?

Jan 23 '06 #1
Share this Question
Share on Google+
1 Reply


P: n/a
Ray wrote:
function displayPage(page,id)
{
/*
alert("Page: "+page)
alert("ID: "+id)
*/

// Set the cookie so the truck page knows which truck to display...
expireDate = new Date;
document.cookie="Truck="+id+";expires="+expireDate ;

// Display the page...
window.location.href=page;
return false;
}

I have used various combinations of the location method including;
window.location=page;
window.location.href=page;
window.navigate=page;
document.location=page;
document.location.href=page;
location=page;
location.href=page;


Whether that approach is applicable depends on how you call displayPage().
If `page' is a URL reference to another second-level domain, it cannot not
work: you can only read and set cookies for the same second-level domain or
the same host address due to security precautions.
PointedEars
Jan 23 '06 #2

This discussion thread is closed

Replies have been disabled for this discussion.