Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Script Loading errors in IE4!! please help!

Status
Not open for further replies.

Nickde

Technical User
Sep 3, 2000
1
ZA
Hi There

I am having problems with a page loading up in a window.I get SYNTAX errors on line 10 char 4 and OBJECT EXPECTED on line 40 char 1.
Here is the code as from the page:

============================================================
<HTML>
<head>
<script language=&quot;JavaScript&quot;>
<!--
function revdetectIE()
{
var RevVersion = 0;
var fso;

try
{
fso = new ActiveXObject(&quot;VoiceControl.ReallyEasy&quot;);
}
catch(errorObject)
{
var iMyWidth;
var iMyHeight;

//gets top and left positions based on user's resolution so hint window is centered.
iMyWidth = (window.screen.width/2) - (365 + 10); //half the screen width minus half the new window width (plus 5 pixel borders).
iMyHeight = (window.screen.height/2) - (250 + 25); //half the screen height minus half the new window height (plus title and status bars).

window.close()

window.open( &quot;freephone.jsp?download=true&quot;, &quot;&quot;, &quot;height=500,width=730,scrollbars,resizable,left=&quot; + iMyWidth + &quot;,top=&quot; + iMyHeight + &quot;,screenX=&quot; + iMyWidth + &quot;,screenY=&quot; + iMyHeight )

return false;
}

var RevVersion = fso.RevVersion;

window.close()

opener.GoLink( unescape(opener.varAction) + &quot;=&quot; + unescape(opener.varData) );
}
//-->
</script>
</head>

<body onLoad=&quot;revdetectIE()&quot;>

<div align=&quot;left&quot;>
<font face=&quot;Arial&quot; color=&quot;ff0000&quot; size=&quot;3&quot;><b>
Please<br>
Wait...
</b></font>
</div>

</body>
</HTML>
============================================================I think it has something to do with the try/catch function but i am not sure - the page is supposed to detect whether the user has installed a certain program , if not then it takes them to a download page , otherwise it loads up the program. I have no ideas on what to put in as a substitute for the try catch function - and are there any other ways to do away with the errors and still keep the try catch function???
Thanks
Nick








I think it has something to do with the try/catch function but i am not sure - the page is supposed to load into the same window and detect whether the user has installed a certain program , if not then it takes them to a download page , otherwise it loads up the program. I have no ideas on what to put in as a substitute for the try catch function - and are there any other ways to do away with the errors and still keep the try catch function??? Thanks Nick
 
try/catch construct is available only in java, not javascript
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top