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 biv343 on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Mystery : window.location.href

Status
Not open for further replies.

z07924

IS-IT--Management
Feb 18, 2002
122
GB
I am trying to redirect based on some conditions. This is the JS

function confirmBox(PageIndex,PreStartPage,Mode)
{
if (confirm('We will charge you to view this page.Do you want to confirm this?'))
{
strHREF = 'CustomerMain.asp?PageIndex=' + PreStartPage + '&mode=' + Mode + '&PremiumAllowed=TRUE'
window.location.href = strHREF
}
else
{
strHREF = 'CustomerMain.asp?PageIndex=' + PageIndex + '&mode=' + Mode + '&PremiumAllowed=FALSE'
window.location.href = strHREF
}

}

It is working perfect in my PC. But when I move this project to other PC's it is NOT working ( and it is driving me crazy). Any help would be highly appreciated.
 
yep, I have tried that too. still no luck...
 
<script>
function confirmBox(PageIndex,PreStartPage,Mode)
{
var url = confirm('We will charge you to view this page.Do you want to confirm this?')
? 'CustomerMain.asp?PageIndex=' + PreStartPage + '&mode=' + Mode + '&PremiumAllowed=TRUE'
: 'CustomerMain.asp?PageIndex=' + PageIndex + '&mode=' + Mode + '&PremiumAllowed=FALSE' ;
location.href = url
}
confirmBox(1, 2, 3)
</script>

This seems to work for me. give it a shot by changing the values in the confirmBox call with valid ones.

Hope this helps. Gary Haran
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top