...

View Full Version : JavaScript/Windows XP Compatibility Issue?



gwsoccer14
04-07-2004, 05:04 PM
For some reason I have a script that works in everything but Windows XP? I have never heard of this before. Any help?

Basically this is for a pop-up form. When the user submits the form the script empties thier cart (cookies) and refreshes the parent page. This works fine until I test it on a Windows XP machine where the code does not work at all. Has anyone else had XP Javascript Issues?

<script language="JavaScript">
<!--
function refreshParent() {
window.opener.location.href = "catalog.asp";
}
//-->
</script>
<script language="JavaScript">
<!--
function removeall() {
var numberofcookies = GetCookie ("number");
DeleteCookie ("number");
for (i=1; i < parseInt(parseInt(numberofcookies)+1); i++) {
DeleteCookie (i);
}
}
//-->
</script>

<body onUnload="refreshParent();removeall()" marginheight="0" marginwidth="0" leftmargin="0" topmargin="0">

sad69
04-13-2004, 09:11 PM
I don't know what the problem would be, but:
1. Why do you have a script tag for each function? You can encapsulate all functions in one script tag.
2. What browser are you testing with? Double check the versions. If you use IE 6 on Windows 2000 and on XP, you should get the same results. Similarly Netscape 7 on either OS should do the same. If you're using the same version browser on different OS's, and you're getting bad results on XP then post back.

Also, how do you know that it's not working at all? Have you put alert statements inside your functions to see that they're being called?

Good luck,
Sadiq.

gwsoccer14
04-13-2004, 09:48 PM
Thanks for your help, I have already fixed the problem. For some reason I included a line that refreshed the child before it closed , and that was causing it to be submitted twice.



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum