...

View Full Version : JS not working in Safari, IE 5.2, more?



drsmartman
05-28-2004, 08:14 PM
Hi All,

I have some code below and was just wondering if it appeared that would cause this script to NOT be cross-browser. The known issues (I'm sure there are more) are IE 5.2 and Safari 1.02 on Mac OS X. The script is in two parts and uses three pages. The purpose being to add various items to an offsite shopping cart application that only takes individual URLs, but my requirements may make it necesary to purchase several items from one form. This DOES work in Netscape 7.1, IE 5.5/6. What am I missing? Thanks DOM/JS experts!

Pages: Frameset, Main Page (with Form), Invisible Page (for opening various URLs passed from the main page form)
Scripts: openURLs() - opens various URLs in Invisible Page from parameters passed from, goShop() - passes multiple URLs to array in Frameset Variables.

----- Start Frame Page -----
<script language="JavaScript">
var loadedPage="0";
var loc = new Array();
var messageShown="false";
var onlineBuy="false";
function openUrls() {
if(loadedPage<loc.length) {
parent.buyWindow.location=loc[loadedPage];
loadedPage++;
}
if(loadedPage==loc.length && loc.length>0 && loadedPage>0 && messageShown=="false" && onlineBuy=="true"){
alert("Going to Secure Shopping Cart");
window.open("https://www.example.com/buyURL");
parent.mainWindow.checkoutLink.innerHTML="Checkout to Secure Shopping Cart";
messageShown="true";
}
}
</script>

<frameset rows="0,*">

<frame src="buy.html" name="buyWindow" onLoad="parent.openUrls()" NORESIZE>
<frame src="registration.php?cf=2" name="mainWindow">

</frameset>
----- End Frame Page -----

----- Start Main page (w/ Form) -----
<script language="JavaScript" type="text/JavaScript">
function goShop(){

alert("The Secure Payment Service is processing. Please wait for the confirmation message. Thank you for your patience");

parent.loc = new Array("https://www.example.com/buyURL/buy.jsp?upc=Member&qty=1","https://www.example.com/buyURL/buy.jsp?upc=A&qty=1","https://www.example.com/buyURL/buy.jsp?upc=B&qty=1","https://www.example.com/buyURLbuy/buy.jsp?upc=C&qty=1");

parent.onlineBuy = "true";**************************************************************** parent.buyWindow.location.reload();
}
</script>
----- End Main Page -----

Any ideas or help as to why this isn't functioning in some browsers is helpful....works on some, not on others. name of the game right? I can provide more information if necesary...works perfect on the browsers mentioned above though. Many, many, many thanks!

Rex
05-29-2004, 10:32 PM
Hello Dr Smart Man -

Is that... everything? You have no <html> or <head> tags whatsoever? I think you really should have.

- Rex



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum