[thelist] What's wrong with this JScript??

Mike Ashton mashton at 4all.com
Mon, 29 Nov 1999 11:19:19 -0500


Evolters.

I'm totally baffled why this code won't work in IE on a MAC!!

It resides in a frame and rewrites the html in an adjoining frame called
'card'.
The URL is at http://www.ematchcorp.com/demo/bizcard/treb/d4/

Your help would be greatly appreciated.

Mike

====begin jscript =======
function refreshCard() {

 if (
document.cardok.layout.options[document.cardok.layout.selectedIndex].value
== "right" ) { basic1(); }
 if (
document.cardok.layout.options[document.cardok.layout.selectedIndex].value
== "center" ) { basic1(); }
 if (
document.cardok.layout.options[document.cardok.layout.selectedIndex].value
== "left" ) { basic1(); }
 if (
document.cardok.layout.options[document.cardok.layout.selectedIndex].value
== "rlp01" ) { rlp01(); }

}

function rlp01() {

if (navigator.appName == "Netscape") {
 Spacer=1;
} else{
 Spacer=0;
}

 with (window.top.card.document) {
 clear();
 open ("text/html");

 writeln ("<!DOCTYPE html public '-//w3c//dtd html 4.0//en'>");
 writeln ("<html><head><title>4ALL BizCard</title>");
 writeln ("<meta http-equiv='Content-Stype-Type' content='text/css'>");
 writeln ("<style>body \{ ");
 writeln ("text-align: left;");
 writeln
(document.cardok.fontFamily.options[document.cardok.fontFamily.selectedIndex].value);

 writeln ("line-height: ",eval(9)+Spacer,"px");
 writeln ("\}</style>");
 writeln ("</head>");
 var Mval;
 Mval=eval(document.cardok.marginSize.options[document.cardok.marginSize.selectedIndex].value)+Spacer*5;

 var Mval2;
 Mval2=eval(document.cardok.marginSize.options[document.cardok.marginSize.selectedIndex].value);

 writeln ("<body
background='",document.cardok.orient.value,"/",document.cardok.cardimg.options[document.cardok.cardimg.selectedIndex].value,"'
marginwidth=",Mval2," marginheight=",Mval," topmargin=",Mval,"
leftmargin=",Mval2,">");
 writeln ("<font
color='#",document.cardok.fontColour.options[document.cardok.fontColour.selectedIndex].value,"'>");

 writeln ("<table width=100% cellpadding=0 cellspacing=0>");
 writeln ("<tr><td valign=middle align=center width=50%>");
 if (
document.cardok.photo.options[document.cardok.photo.selectedIndex].value
!= "null" ) {
 writeln ("<img
src='",document.cardok.photo.options[document.cardok.photo.selectedIndex].value,"'
valign=top border=0><br>");
 }
 write ("<font
style='",document.cardok.fontFamily.options[document.cardok.fontFamily.selectedIndex].value,"
");
 write ("line-height:
",eval(document.cardok.companySize.options[document.cardok.companySize.selectedIndex].value)+Spacer,"px;'");

 writeln ("
color='#",document.cardok.fontColour.options[document.cardok.fontColour.selectedIndex].value,"'
>");
 write ("<font style='font-size:
",eval(document.cardok.nameSize.options[document.cardok.nameSize.selectedIndex].value)+Spacer,"px;'>");

 writeln (document.cardok.name.value,"<br></font>");

 if ( eval(document.cardok.title.value.length) > 0 ) {
 write ("<font style='font-size:
",eval(document.cardok.titleSize.options[document.cardok.titleSize.selectedIndex].value)+Spacer,"px;'>");

 writeln (document.cardok.title.value,"</font>");
 }

 writeln ("</td><td align=left><img src='land/RLP_third.gif'
valign=center border=0><br><br>");
 writeln ("<font
color='#",document.cardok.fontColour.options[document.cardok.fontColour.selectedIndex].value,"'>");

 write ("<font
style='",document.cardok.fontFamily.options[document.cardok.fontFamily.selectedIndex].value);

 writeln ("line-height:
",eval(document.cardok.companySize.options[document.cardok.companySize.selectedIndex].value)+Spacer,"px
'>");

 writeln ("<font style='font-size:
",eval(document.cardok.companySize.options[document.cardok.companySize.selectedIndex].value)+Spacer,"px'>
");
 writeln (document.cardok.company.value,"<br></font>");

 writeln ("<font style='font-size:
",eval(document.cardok.addressSize1.options[document.cardok.addressSize1.selectedIndex].value)+Spacer,"px'>");

 writeln (document.cardok.address1.value,"<br></font>");

 if ( eval(document.cardok.address2.value.length) > 0 ) {
 writeln ("<font style='font-size:
",eval(document.cardok.addressSize2.options[document.cardok.addressSize2.selectedIndex].value)+Spacer,"px'>");

 writeln (document.cardok.address2.value,"<br></font>");
 }

 writeln ("<font style='font-size:
",eval(document.cardok.citySize.options[document.cardok.citySize.selectedIndex].value)+Spacer,"px'>");

 writeln (document.cardok.city.value,", </font>");

 writeln ("<font style='font-size:
",eval(document.cardok.stateSize.options[document.cardok.stateSize.selectedIndex].value)+Spacer,"px'>");

 writeln (document.cardok.state.value,"<br></font>");

 writeln ("<font style='font-size:
",eval(document.cardok.zipSize.options[document.cardok.zipSize.selectedIndex].value)+Spacer,"px'>");

 writeln (document.cardok.zip.value,"<br><br></font>");

 writeln ("<font style='font-size:
",eval(document.cardok.phoneSize1.options[document.cardok.phoneSize1.selectedIndex].value)+Spacer,"px'>");

 writeln (document.cardok.phone1.value,"<br></font>");

 writeln ("<font style='font-size:
",eval(document.cardok.phoneSize2.options[document.cardok.phoneSize2.selectedIndex].value)+Spacer,"px'>");

 writeln (document.cardok.phone2.value,"<br></font>");

 if ( eval(document.cardok.phone3.value.length) > 0 ) {
 writeln ("<font style='font-size:
",eval(document.cardok.phoneSize3.options[document.cardok.phoneSize3.selectedIndex].value)+Spacer,"px'>");

 writeln (document.cardok.phone3.value,"<br></font>");
 }

 if ( eval(document.cardok.message.value.length) > 0 ) {
 writeln ("<font style='font-size:
",eval(document.cardok.messageSize.options[document.cardok.messageSize.selectedIndex].value)+Spacer,"px'>");

 writeln (document.cardok.message.value,"</font><br>");
 }

 writeln ("</td></tr></table>");
 writeln ("</font></body></html>");
 close();
 }
}

======end jscript=========

--
====================================================================
Mike Ashton                                mashton@ematchcorp.com
eMatchCorp.com                             ph: 416.410.9863
3790 Victoria Park Ave. Suite 210          fx: 416.499.1275
Toronto, Ontario M2H 3H7                   http://www.ematchcorp.com
====================================================================
********                        NOTICE                     *********
This email may contain confidential and/or privileged information
for the sole use of the intended recipient.  Any review or
distribution by others is strictly prohibited. If you have received
this email in error, please contact the sender and delete all
copies. Opinions, conclusions or other information expressed or
contained in this email are not given or endorsed by the sender
unless otherwise affirmed independently by the sender.
====================================================================
PGP Fingerprint:                 mashton@4all.com
B449 07E4 9BF7 914A AFBA 1531 B576 9116 660A 1C40
====================================================================