[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: lynx-dev JS onclick
From: |
A. R. Vener |
Subject: |
Re: lynx-dev JS onclick |
Date: |
Sun, 30 Jul 2000 11:58:19 -0400 (EDT) |
After reading some of the talk about terpreting the onClick Javascript
function I retrieved this HTML. It doesn't look quite as
simple as parsing the onClick to get a URL:
<HTML>
<HEAD>
<TITLE>Lynx Unfreindly Site</TITLE>
<SCRIPT LANGUAGE=3D"javascript">
<!--
//browser sniffing
var nav =3D false;
var ie =3D false;
var agt=3Dnavigator.userAgent.toLowerCase();
var is_major =3D parseInt(navigator.appVersion);=20
var is_minor =3D parseFloat(navigator.appVersion);=20
var is_nav =3D ((agt.indexOf('mozilla')!=3D-1) && =
(agt.indexOf('spoofer')=3D=3D-1)=20
&& (agt.indexOf('compatible') =3D=3D -1) && =
(agt.indexOf('opera')=3D=3D-1)=20
&& (agt.indexOf('webtv')=3D=3D-1));=20
var is_ie =3D (agt.indexOf("msie") !=3D -1); =20
var is_nav4up =3D (is_nav && (is_major >=3D 4));
var is_ie4up =3D (is_ie && (is_major >=3D 4));=20
var is_webtv =3D (agt.indexOf("webtv") !=3D -1);=20
//detects browser type
if(parseInt(navigator.appVersion) >=3D 4) {
if (navigator.appName =3D=3D "Netscape") {
nav =3D true;
} else if (navigator.appName =3D=3D "Microsoft Internet Explorer") {
ie =3D true;
domObj =3D "window.";
}
}
var isIt4 =3D (is_nav4up||is_ie4up||is_webtv);
//end browser sniffing
//kick out non-DHTML MS and NN browsers
if(isIt4=3D=3Dfalse) {
self.document.location =3D "/redirect.htm";
}
//set the domOvj variable for IE
var domObj =3D "";
if (is_ie4up) domObj =3D "window.";
var userInfo =3D new Array();
//handle Netscape resizing
//but exclude version 4.0x browsers
//because they are wacky w/onResize event
function handleResize() {
location.reload();
return false;
}
if =
(navigator.appName=3D=3D"Netscape"&&parseFloat(navigator.appVersion)>4.09=
) {
window.captureEvents(Event.RESIZE)
window.onresize =3D handleResize
} =20
=20
//Get back to business...=20
//------------------------------------
//-------------------------------------
//The window opener
var streamerWin =3D null;
function opensWindow(url, name, w, h) {
//make sure the window is closed
if (!streamerWin || streamerWin.closed) {
//Hook myself up with the size variables=20
var w0, h0;
//These are the parameters - refer to the VAR "variables"
var dirs =3D "no";
var loc =3D "no";=20
var menu =3D "no";=20
var scrs =3D "yes";=20
var stat =3D "no";
var tool =3D "no";
var resize =3D"yes";
=20
//this sets the width in pixels
w0 =3D w;
h0 =3D h;
//if screen resolution is more than 800x600, shrink the window
if (isIt4 =3D=3D true) {
if (h0 > 500 && eval(domObj + "screen.height") < 700) {
h0 =3D h0*.80;=20
}
}
//make sure the height and width are integers
w0 =3D parseInt(w0);
h0 =3D parseInt(h0);=20
=20
//set up the window property variables for interpolation
var features =3D
'width=3D' + w0 +
',height=3D' + h0 +
',directories=3D' + dirs +
',location=3D' + loc +
',menubar=3D' + menu +
',scrollbars=3D' + scrs +
',status=3D' + stat +
',toolbar=3D' + tool +
',resizable=3D' + resize;
=20
//open the window already
streamerWin =3D window.open(url, name, features); =20
=20
} else {
streamerWin.document.location =3D url;
streamerWin.focus();
}
}
function setStatus(msg) {
window.status =3D msg;
return true;
}
//css-variable
var cssvar =3D '';
cssvar=3D'<STYLE type=3D"text/css">TD {font-family:Arial; =
font-size:10pt;}TD.eight {font-size:8pt;}TD.nine =
{font-size:9pt;}TD.title {font-family:"Arial Black"; =
color:#ffffff;}TD.twelve {font-size:12pt}TD.sub {color:#ffffff; =
font-weight:700;}#u {color:#009900; font-weight:700;}#d {color:#CC0000; =
font-weight:700;}#streamer {color:#336699}}#help {font-size:11pt; =
font-family:Arial; color:#ffffcc;}</style>';
//-->
</SCRIPT>
</HEAD>
=20
<!-- frames -->
<FRAMESET ROWS=3D"72,*" FRAMESPACING=3D"0" BORDER=3D"0" =
FRAMEBORDER=3D"no">
<FRAME NAME=3D"topnav" SRC=3D"/top/top.htm" MARGINWIDTH=3D"0" =
MARGINHEIGHT=3D"0" SCROLLING=3D"no" FRAMEBORDER=3D"no">
<FRAME NAME=3D"body" SRC=3D"/dummy.htm" MARGINWIDTH=3D"0" =
MARGINHEIGHT=3D"0" SCROLLING=3D"auto" FRAMEBORDER=3D"no">
</FRAMESET>
</HTML>
; To UNSUBSCRIBE: Send "unsubscribe lynx-dev" to address@hidden
- Re: lynx-dev JS onclick (was still learning), Henry Nelson, 2000/07/30
- Re: lynx-dev JS onclick, Philip Webb, 2000/07/30
- Re: lynx-dev JS onclick, David Woolley, 2000/07/30
- Re: lynx-dev JS onclick, pAb-032871, 2000/07/30
- Re: lynx-dev JS onclick, Philip Webb, 2000/07/31
- Re: lynx-dev JS onclick, A. R. Vener, 2000/07/31
- Re: lynx-dev JS onclick, Patrick Boylan, 2000/07/31
- Re: lynx-dev JS onclick, Natasha Live, 2000/07/31
- Re: lynx-dev JS onclick, mattack, 2000/07/31
- Re: lynx-dev JS onclick, Patrick, 2000/07/31
Re: lynx-dev JS onclick,
A. R. Vener <=