Click to See Complete Forum and Search --> : Why not work with Netscape?


Tasmanian Devil
05-31-2003, 09:58 AM
why does this script work in IE not Netscape?
<head>
<style type="text/css">
.pane {
display : none;
}
td.tabs {
border-top : light outset white;
border-left : light outset white;
}
div.tabs {
background-color : #ffffff;
cursor : hand;
}
</style>
<style type="text/css">
body {
background-color : #ffffff;
}
input.txt {
position : absolute;
left : 120px;
}
input.chk {
position : relative;
}
</style>
<script type="text/javascript">
var currentPaneStyle = 0;
var currentTab = 0;
function tabstrip()
{
this.tabs = new Array();
this.add = addTab;
this.write = writeTabstrip;
}
function tab(caption,content)
{
this.setId = setId;
this.caption = caption;
this.content = content;
this.write = writeTab;
this.writeContent = writePane;
}
function addTab(tab)
{
tab.setId("tab" + this.tabs.length);
this.tabs[this.tabs.length] = tab;
}
function setId(id)
{
this.id = id;
}
function initiate()
{
var div = document.getElementById("tab0");
showPane(div);
}
function showPane(div)
{
if(currentTab != 0)
{
currentTab.style.backgroundColor = "#ffffff";
}
div.style.backgroundColor = "#ffffff";
currentTab = div;
if(currentPaneStyle != 0)
currentPaneStyle.display = "none";
var paneId = "pn_" + div.id;
var objPaneStyle = document.getElementById(paneId).style;
objPaneStyle.display = "block";
currentPaneStyle = objPaneStyle;
}
function SubmitForm()
{
tabform.submit();
}
function writePane()
{
document.write("<div class='pane' id='pn_" + this.id + "'>" + this.content + "</div>");
}
function writeTab()
{
document.write("<td class='tabs'><div class='tabs' id='" + this.id + "' onclick='showPane(this)'>" + this.caption + "</div></td>");
}
function writeTabstrip()
{
document.write("<table class='tabs'><tr>");
for(var i = 0; i < this.tabs.length; i++)
{
this.tabs[i].write();
}
document.write("</tr></table>"); for(var k = 0; k < this.tabs.length; k++)
{
this.tabs[k].writeContent();
}
initiate();
}
</script>
</head>
<body onUnload="spawntopfivewindow();">
<script language="Javascript" src="fctrack.js">
</script>
<div align="center">
<pre><b><font size="+7" color="#000000" face="Times New Roman, Times, serif">Fox Valley Newspapers</font><font face="Comic Sans MS" size="+7" color="#000000">
<font face="Verdana, Arial, Helvetica, sans-serif" size="4" color="#FF0000">To Subscribe to the newspaper(s)
for your choice please fill out
the following form.</font></font></b></pre>
<p>Once all of the contact information is filled out, just click on the newspaper
choices </p>
<p>(put a check next to the paper and click when you would like to receive it if applicable), then
click the billing options</p>
</div>
<form name="tabform" method="post" action="cgi-t/form.cgi">
<p>
<script type="text/javascript">

var pane2 = "<table border=10><tr><td>Newspaper Choices:<br><input type='checkbox' name='Barrons Paper' value='Subscribe Me'>Barron's </input><br><input type='checkbox' name='Chicago Suntimes Paper' value='Subscribe Me'>Chicago Suntimes</input><br><input type='checkbox' name='Fincanial Times Paper' value='Subscribe Me'> Fincanial Times</input><br><input type='checkbox' name='Investor Business Paper' value='Subscribe Me'> Investor Business </input><br><input type='checkbox' name='New York Times Paper' value='Subscribe Me'>New York Times</input><br><input type='checkbox' name='Wall Street Journal Paper' value='Subscribe Me'> Wall Street Journal</input><br><td rowspan=2>Full Week:<br><input type='radio' name= ‘Barrons' value=’Full Week’>N/A</input><br><input type='radio' name='Chicago Suntimes' value=' Full Week'>N/A</input><br><input type='radio' name='Fincanial Times' value=' Full Week '>N/A</input><br><input type='radio' name='Investor Business' value='Full Week '>N/A</input><br><input type='radio' name='New York Times' value='Full Week'>$49.00</input><br><input type='radio' name='Wall Street Journal' value='Full Week'>N/A</input><br><td rowspan=3>Monday - Friday:<br><input type='radio' name= ‘Barrons' value='Monday - Friday'>N/A</input><br><input type='radio' name='Chicago Suntimes ' value='Monday - Friday'>N/A</input><br><input type='radio' name='Fincanial Times' value='Monday - Friday'>$7.00</input><br><input type='radio' name='Investor Business' value='Monday - Friday'>$7.00</input><br><input type='radio' name='New York Times' value='Monday - Friday'>N/A</input><br><input type='radio' name='Wall Street Journal' value='Monday - Friday'>$6.00</input><br><td rowspan=4>Monday - Saturday:<br><input type='radio' name= ‘Barrons' value='Monday - Saturday'>N/A</input><br><input type='radio' name='Chicago Suntimes ' value='Monday - Saturday'>N/A</input><br><input type='radio' name='Fincanial Times' value='Monday - Saturday'>N/A</input><br><input type='radio' name='Investor Business' value='Monday - Saturday'>N/A</input><br><input type='radio' name='New York Times'value='Monday - Saturday'>$28.00</input><br><input type='radio' name='Wall Street Journal' value='Monday - Saturday'>N/A</input><br><td rowspan=6>Saturday Only:<br><input type='radio' name=‘Barrons' value='Saturday Only'>$3.75</input><br><input type='radio' name='Chicago Suntimes ' value='Saturday Only'>N/A</input><br><input type='radio' name='Fincanial Times’ value='Saturday Only'>$1.25</input><br><input type='radio' name='Investor Business' value='Saturday Only'>N/A</input><br><input type='radio' name='New York Times' value='Saturday Only'>N/A</input><br><input type='radio' name='Wall Street Journal' value='Saturday Only'>N/A</input><br><td rowspan=7>Sunday Only:<br><input type='radio' name=‘Barrons' value='Sunday Only'>N/A</input><br><input type='radio' name='Chicago Suntimes ' value='Sunday Only'>$2</input><br><input type='radio' name='Fincanial Times' value='Sunday Only'>N/A</input><br><input type='radio' name='Investor Business' value='Sunday Only'>N/A</input><br><input type='radio' name='New York Times' value='Sunday Only'>$22.00</input><br><input type='radio' name='Wall Street Journal' value='Sunday Only'>N/A</input><br><td rowspan=8>Weekend Only:<br><input type='radio' name=‘Barrons' value='Weekend Only'>N/A</input><br><input type='radio' name='Chicago Suntimes ' value='Weekend Only'>N/A</input><br><input type='radio' name='Fincanial Times' value='Weekend Only'>N/A</input><br><input type='radio' name='Investor Business' value='Weekend Only'>N/A</input><br><input type='radio' name='New York Times' value='Weekend Only'>$27.00</input><br><input type='radio' name='Wall Street Journal' value='Weekend Only'>N/A</input></table>";

var pane1 = "First Name: <input type='text' class='txt' name='First Name' size=20></input><br><br>Last Name: <input type='text' class='txt' name='Last Name' size=20></input><br><br>Address: <input type='text' class='txt' name='Address' size=20></input><br><br>Apartment: <input type='text' class='txt' name='Apartment' size=20></input><br><br>City: <input type='text' class='txt' name='City' size=20></input><br><br>State: <input type='text' class='txt' name='State' value='Wisconsin' onFocus='this.blur()' size=20></input><br><br>ZIP:<input type='text' class='txt' name='Zip'size=20></input><br><br>E-Mail:<input type='text' class='txt' name='E-Mail' size=20></input><br><br>Home Phone: <input type='text' class='txt' name='Home Phone' size=20 onChange=fmtPhoneno(this);></input><br><br>Work Phone: <input type='text' class='txt' name='Work Phone' size=20 onChange=fmtPhoneno(this);></input>";

var pane3 = "<table border=0><tr><td>Bill Me For:<br><input type='radio' name='Bill Me For' value='1 Month'>1 Month</input><br><input type='radio' name='Bill Me For' value='3 Months'>3 Months</input><br><input type='radio' name='Bill Me For' value='6 Months'>6 Months</input></td>";
var pane4 = "<table border=0><tr><td></td>";

var ts = new tabstrip();
var t1 = new tab("Contact Information",pane1);
var t2 = new tab("Newspaper Choices",pane2);
var t3 = new tab("Billing Options",pane3);
var t4 = new tab("",pane4);
ts.add(t1);
ts.add(t2);
ts.add(t3);
ts.add(t4);
ts.write();
</script>
<input type=hidden name="to" value=" subscribe@foxvalleynews.com">
<input type=hidden name="redirect" value="http://foxvalleynews.com/thank you for your subscription.html">
<input type=hidden name="subject" value="Fox Valley Area Subscription">
<input type=HIDDEN name=from value="subscribe@foxvalleynews.com">
<input type=hidden name="required" value="First Name,Last Name,Address,City,Zip,E-Mail,Bill Me For">
<input type=hidden name="print_blank_fields" value="1">
</p>
</form>
<button onclick="SubmitForm()">Subscribe Me Now</button>
<form name="form1" method="post" action="">
</form>
<p>&nbsp;</p>
<img src="http://www.foxvalleynews.com/cgi-t/counter?df=foxvalleynews.com.FoxValleyArea&sh=0">
</body>

Can anyone help me? I love the script but needs to work in Netscape.
Thanks

Jona
05-31-2003, 10:54 AM
Doesn't work for me in IE6..

Jona

AdamGundry
05-31-2003, 11:22 AM
Doesn't work in Mozilla 1.3 either - it gives the message "Error: spawntopfivewindow is not defined" several times.

Adam

Jona
05-31-2003, 12:23 PM
Adam, I just realized. The reason we get this error is because his onUnload function is probably in the fctrack.js file, which we don't have here. I didn't see this function defined in the source code given.

Jona

Tasmanian Devil
05-31-2003, 12:41 PM
I have IE 6 and it works for me, but in netscape it just thinks and does not change pages or anything.

fctrack.js is as follows-
function GetFCDomain() {

// have to replicate this adscript.global.new.js function here cos we call this within www2 etc.

this_location = document.location.toString();

this_host = this_location.substring(this_location.indexOf('http://') + 7);

this_host = this_host.substring(0,this_host.indexOf('/'));

this_domain = this_host.substring(this_host.indexOf('.'));

if(this_domain.indexOf(':') != -1) { // yeah even works with port numbers

this_domain = this_domain.substring(0,this_domain.indexOf(':'));
}

return(this_domain); // it's prepended with a period for cookie use btw
}





// this stuff for point-of-origin

// function getfcreferer: works out what value to use for the referer variable

function getfcreferer() {

my_location = document.location.toString();

fcreferer = document.referrer.toString();

if (my_location.indexOf('?referer=') != -1 && my_location.indexOf('?referer=navbar') == -1) {

fcreferer = 'R-' + my_location.substring(my_location.indexOf('?referer=') + 9);
}


else if (fcreferer != '' && (document.referrer.indexOf('.fortunecity.com') == -1)) {

fcreferer = fcreferer.substring(fcreferer.indexOf('/') + 2);

fcreferer = 'V-' + fcreferer.substring(0,fcreferer.indexOf('/'));

}

else {

fcreferer = 'V-unknown'; // just so we always set _something_
}

return(fcreferer);

}





// function GetExistingUniqueID: digs a unique ID out of the fcfirstseen or fctrack cookie

function GetExistingUniqueID(cookiename,withreferer) {

// id's are like this, for example: unique_id.R.referer

var existing_id = document.cookie.toString();
var existing_id = existing_id.substring(existing_id.indexOf(cookiename) + cookiename.length + 1);

if (existing_id.indexOf(';') != -1) { // there's more than one cookie defined

var existing_id = existing_id.substring(0,existing_id.indexOf(';'));
}

var output_id = existing_id.substring(0,existing_id.indexOf('-')) + '-';

if (withreferer == 1) {

return(existing_id); // return the whole darn thing
}

existing_id = existing_id.substring(existing_id.indexOf('-') + 1);


output_id += existing_id.substring(0,existing_id.indexOf('-'));

// ugly but 1.0 compatible

return(output_id);
}





// function setvisitorcookie: sets unique IDs and cookie version

function setvisitorcookie(clientip) {


// need to reset my_ord 'cos we haven't always displayed an ad on the page

my_date = new Date();
my_ord = my_date.getTime();


// let's see what we want to use for the referer value


this_referer = getfcreferer();


// check for existing cookies - don't overwrite these

if(document.cookie.indexOf('fcfirstseen') == -1) {


// create the fcfirstseen cookie

my_unique = Math.round(my_ord / 1000) + '-' + clientip + '-' + this_referer;

last_forever = new Date(my_ord + 315360000000); // well 10 years anyway

document.cookie = "fcfirstseen=" + my_unique + "; path=/; domain=.fortunecity.com; expires=" + last_forever.toGMTString();

}



else {

// use the unique id from the fcfirstseen cookie, so we use this in the fctrack cookie

my_unique = GetExistingUniqueID('fcfirstseen',0) + '-' + this_referer;

}





// set a new fctrack cookie if this is the first visit or the old one's expired


if(document.cookie.indexOf('fctrack') == -1) {


// get the visit type (V or R)

visit_type = this_referer.substring(0,this_referer.indexOf('-'));



if (visit_type == 'R') {

// paid referral, so we retain for 30 days

my_expiry = new Date(my_ord + (86400000 * 30)); // 1 day in milliseconds
}

else {

// casual visit, so we retain for 1 day

my_expiry = new Date(my_ord + (86400000)); // 1 day in milliseconds
}



document.cookie = "fctrack=" + my_unique + "; path=/; domain=.fortunecity.com; expires=" + my_expiry.toGMTString();

}

//document.write('<br>COOKIE ' + document.cookie + '<br>');

}







// function DeriveSignupID: this is called by the join page. We get anything in the query string, then anything in fctrack, then finally anything in fcfirstseen

function DeriveSignupID () {

my_referer = getfcreferer();

if (my_referer.substring(0,2) == 'R-') {

return(my_referer.substring(2)); // we've overridden using the query string
}

else { // start checking the cookies

my_unique = GetExistingUniqueID('fctrack',1) // try this first

my_unique = my_unique.substring(my_unique.lastIndexOf('-') + 1);

if (my_unique == null) {

my_unique = GetExistingUniqueID('fcfirstseen',1) // try this, then

my_unique = my_unique.substring(my_unique.lastIndexOf('-') + 1);
}
}

// if all else fails, just take the HTTP_REFERER hostname

if ((my_unique == null|| my_unique == '') || my_unique == 'V-unknown') {

var my_unique = my_referer.substring(2);
}

return(my_unique);
}




// function setmembercookie: this is called from Page Manager. I've now made it it's own cookie so we can use it more easily to suppress popups and stuff.

function setmembercookie(userid) {

// set a long ass cookie

my_date = new Date();

last_forever = new Date(my_date.getTime() + 315360000000); // well 10 years anyway

document.cookie = 'fcid=' + userid + '; path=/; domain=' + GetFCDomain() +'; expires=' + last_forever.toGMTString();

return;
}


// function IsFCMember: check whether user is a member; use to suppress annoying popups etc.

function IsFCMember() {

var is_member = 0;

if (document.cookie.indexOf('fcid=') != -1) {

is_member = 1;
}

return is_member;
}

Thanks ladies and gentlemen

Tasmanian Devil
06-02-2003, 06:48 PM
Dave & Jona~
Can you help me out on the one listed above?
Thanks