PDA

View Full Version : Can't get document.write function to open frameset on all browsers



tekman
06-23-2002, 01:47 PM
Hi, we're trying to integrate an externally hosted shopping cart into our non framed site, and I've set up the document.write script below to create a frameset, to handle this - however it only works in IE5+ (Mac). As much use as a fart in a spacesuit! Any sugestions in getting it to work on IE4+ (Mac/Windows) and even better NN4+ (Mac/Windows).

I have to confess my virginity with Javascript, I'm a cut/paste man + trial/error slave.
Any alternative code would be most appreciated.

An example link code to access the page below would be
href="frameset.htm?http://www.externalwebsitecall.com/"

<html>
<head>
<title>Example Framed Shopping Cart</title>
</head>
<body>
<script language="JavaScript">
var input = location.search.substring(1);
var ampersand = input.indexOf('&');
document.write('<frameset rows="131,321*" cols="*" frameborder="NO" border="0" framespacing="0"');
document.write('<frame name="cartftop" scrolling="NO" noresize src="carttopbarj2.htm">');
document.write('<frameset cols="130,591*" frameborder="NO" border="0" framespacing="0" rows="*">');
document.write('<frame name="cartfleft" scrolling="NO" src="cartsidebarj2.htm" noresize>');
document.write('<frame name="cartfmainwindow" src="' + input.substring (0) + '"scrolling="yes">');
document.write('<\/frameset>');
</script>
<br>
</body>
</html>

tekman
06-23-2002, 03:24 PM
Thanks Dave.

No the question wasn't dumb at all, but you've probably guessed this isn't my area of speciality.

Tried it out and works perfectly.

Simple when your shown how.

:thumbsup:

Cheers

Tekman (Bernie)