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 bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Need some help finding the problem in syntax for a friend.

Status
Not open for further replies.

ID10T16

Technical User
Sep 22, 2000
160
US
I got a friend that's got this error with her javascript in a webpage. I haven't done any development in a LONG time, & therefore the correct syntax slips my mind.

Here's the code. It says there is a ) missing on line 23. If I'm so unaquainted with it to not see this error, mayhaps it's time I got back into development. Anyways, here's the code.

<html>
<head>
<title></title>

<meta name=&quot;generator&quot; content=&quot;Created Using Yahoo! PageBuilder 2.61.84&quot;>
<meta name=&quot;author&quot; content=&quot;&quot;>
<meta name=&quot;keywords&quot; content=&quot;Christianity, weblog, journal&quot;>
<script src=&quot;<script>
function updateLock(c) {
var x = getViewXOffset() + c.xAnchor * (getViewWidth() - c.imageWidth) / 2 + c.xOffset * (c.xAnchor == 2 ? -1 : 1);
var y = getViewYOffset() + c.yAnchor * (getViewHeight() - c.imageHeight) / 2 + c.yOffset * (c.yAnchor == 2 ? -1 : 1);
moveLayer(c.prefix + 0, x, y);
setTimeout('updateLock(c' + c.uid + ')', c.updateInterval);
}
</script>

<meta http-equiv=&quot;Page-Enter&quot; content=&quot;blendTrans(Duration=4)&quot;>
<meta http-equiv=&quot;Page-Exit&quot; content=&quot;blendTrans(Duration=4)&quot;>
</head>
<body bgcolor=&quot;#9999CC&quot; link=&quot;#0000FF&quot; vlink=&quot;#000099&quot; text=&quot;#000000&quot;

* I believe the problem starts here*

onLoad=&quot;window.onresize=new Function('if (navigator.appVersion=='Netscape') history.go(0); else center();') center();&quot;>
<script>
if (layerSupport()) {
c694 = new config();
c694.uid = 694
c694.prefix = &quot;y_lock694&quot;;
c694.image = &quot;c694.imageWidth = 292;
c694.imageHeight = 256;
c694.startOnScreen = false;
c694.xAnchor = 0;
c694.yAnchor = 2;
c694.xOffset = 0;
c694.yOffset = 0;
writeImages(c694);
setTimeout('updateLock(c694)', c694.updateInterval);
}
</script>
<script>
if (layerSupport()) {
c706 = new config();
c706.uid = 706
c706.prefix = &quot;y_lock706&quot;;
c706.image = &quot;c706.imageWidth = 300;
c706.imageHeight = 50;
c706.startOnScreen = false;
c706.xAnchor = 2;
c706.yAnchor = 2;
c706.xOffset = 0;
c706.yOffset = 0;
writeImages(c706);
setTimeout('updateLock(c706)', c706.updateInterval);
}
</script>
<script>
if (layerSupport()) {
c713 = new config();
c713.uid = 713
c713.prefix = &quot;y_lock713&quot;;
c713.image = &quot;c713.imageWidth = 300;
c713.imageHeight = 50;
c713.startOnScreen = false;
c713.xAnchor = 1;
c713.yAnchor = 2;
c713.xOffset = 0;
c713.yOffset = 0;
writeImages(c713);
setTimeout('updateLock(c713)', c713.updateInterval);
}
</script>
<script>
function center() {
if (navigator.appVersion.indexOf('MSIE') != -1)
document.all['root'].style.left = Math.max((document.body.clientWidth - 780) / 2, 0);
else
document.PageElement.LAYERS['root'].left = Math.max((window.innerWidth - 780) / 2, 0);
}
</script>

Thanx for the help that anyone can offer.
 
The problem I found is in line:

Code:
=&quot;window.onresize
=new Function('if (navigator.appVersion=='Netscape') 
              ^--------------------------^
            this quote            closed by this quote

I suggest you to define the funtion separately rather than inline. something like:

Code:
<script language=&quot;javascript&quot;>
function init() {
	window.onresize = new Function(&quot;if (navigator.appVersion=='Netscape') history.go(0);&quot;);
}
</script>

<body bgcolor=&quot;#9999CC&quot; link=&quot;#0000FF&quot; vlink=&quot;#000099&quot; text=&quot;#000000&quot;
onLoad=&quot;init()&quot;>
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top