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

Jun 23rd, 2002, 02: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

<title>Example Framed Shopping Cart</title>
<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">');

Jun 23rd, 2002, 04: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.



Tekman (Bernie)