Now I've got a CGI Question: Form sorting... ???

Entity

Lifer
Oct 11, 1999
10,090
0
0
Here's my redirect page:

<script language=&quot;JavaScript&quot;>



// Finding out which browser is being used//

var type;

name = navigator.appName;

ver = parseInt(navigator.appVersion);

if (name == &quot;Netscape&quot; &amp;&amp; ver >= 3) { type = 1; }

else if (name == &quot;Microsoft Internet Explorer&quot; &amp;&amp; ver >= 4) { type = 2; }

else { type = 0 }


//Dealing with Netscape 3 and later//

if ( type == 1 ) {

var tools=java.awt.Toolkit.getDefaultToolkit();
var size=tools.getScreenSize();
w=size.width;

if ( w <= 640 ) {
location.href = &quot;http://www.hikefordiabetes.org/intro800.htm&quot;;
}

else if ( w >= 641 &amp;&amp; w <= 800 ) {
location.href = &quot;http://www.hikefordiabetes.org/intro800.htm&quot;;
}

else if ( w >= 801 ) {
location.href = &quot;http://www.hikefordiabetes.org/intro.htm&quot;;
}

}



//Dealing with MSIE4 (this bit of script will also work for Netscape4)//

else if ( type == 2 ) {
if (screen.height==&quot;480&quot;) {
location.href=&quot;http://www.hikefordiabetes.org/intro800.htm&quot;;
}

if (screen.height==&quot;600&quot;) {
location.href=&quot;http://www.hikefordiabetes.org/intro800.htm&quot;;
}

if (screen.height>&quot;600&quot;) {
location.href=&quot;http://www.hikefordiabetes.org/intro.htm&quot;;
}
}

//Dealing with everything else - default to lowres mode//

else if ( type == 0 ) {
if ( confirm(&quot;Low screen resolution, the use of Netscape2 or other old browser has been detected.\n\nAlthough we have provided for this possibility, you may be unable to use all the features of this site.\n\nIf you are using Microsoft Internet Explorer 3 with a screen resolution of 800x600 or greater, please click on CANCEL, otherwise click on OK.&quot;) == false ) {
location.href = &quot;http://www.hikefordiabetes.org/intro.htm&quot;;
}
else {
location.href = &quot;http://www.hikefordiabetes.org/intro800.htm&quot;;
}
}

</script>

Anyone know what's wrong with that? It works in IE5 and NS...but not Opera. Opera just gets a blank page.

Location:

Page

Rob
 

Entity

Lifer
Oct 11, 1999
10,090
0
0
PS - This redirect:

<script>
var width = screen.width;var res =(((!(640-width))*1)+((!(800-width))*2)+((!(1024-width))*3)+((!(1152-width))*4)+((!(1280-width))*5)+((!(1600-width))*6)); if(!(res)) res = 1;if (res=='1') {window.location='http://www.hikefordiabetes.org/intro800.htm'}if (res=='2') {window.location='http://www.hikefordiabetes.org/intro.htm'}if (res=='3') {window.location='http://www.hikefordiabetes.org/intro.htm'}if (res!='1' &amp;&amp; res!='2' &amp;&amp; res!='3') {window.location='http://www.hikefordiabetes.org/intro.htm'}
</script>

Yields the same results. Fine in IE, not in Opera.

:|

Rob
 

DAM

Diamond Member
Jan 10, 2000
6,102
1
76
is this the script i posted yesterday on your other thread? i think thats an issue with opera, heres what i got using opera 4.02.


dam()


var width = screen.width;
var res =(((!(640-width))*1)+((!(800-width))*2)+((!(1024-width))*3)+((!(1152-width))*4)+((!(1280-width))*5)+((!(1600-width))*6));
if(!(res)) res = 1;
if (res=='1') {window.location='http://www.hikefordiabetes.org/intro800.htm'}
if (res=='2') {window.location='http://www.hikefordiabetes.org/intro.htm'}
if (res=='3') {window.location='http://www.hikefordiabetes.org/intro.htm'}
if (res!='1' &amp;&amp; res!='2' &amp;&amp; res!='3') {window.location='http://www.hikefordiabetes.org/intro.htm'}
 

Entity

Lifer
Oct 11, 1999
10,090
0
0
Yeah, I'm reverting to my old script. Opera is just fuxored when it comes to this stuff. I don't know how to make it happy. Too bad, too, because I like(d) it as a browser. :|

Rob
 

Entity

Lifer
Oct 11, 1999
10,090
0
0
Hey DAM,

You wouldn't, by chance, know how to make a form sort itself upon emailing, would you? Maybe have some spare CGI laying around?

:p

Rob