Adobe Dreamweaver "Syntrax Error" |
Adobe Dreamweaver "Syntrax Error" |
kyle246 |
Sep 8 2011, 08:13 PM
Post
#1
|
Member Group: Members Posts: 57 Joined: 29-January 11 Member No.: 13,738 |
I just finished creating a html template in Dreamweaver. The template says "no syntrax errors," BUT when I try to make a new web page using the template, then it says "syntrax error" and the page is all messed up.
It says that the error is on line 47. I will give you the bit of code and line 47 is the very last line that I will give you here. QUOTE <script type="text/javascript"> function MM_swapImgRestore() { //v3.0 var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc; } function MM_preloadImages() { //v3.0 var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array(); var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++) if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}} } function MM_findObj(n, d) { //v4.01 var p,i,x; if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) { d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);} if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n]; for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document); if(!x && d.getElementById) x=d.getElementById(n); return x; } function MM_swapImage() { //v3.0 var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3) if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];} } </script> Dreamweaver says that the syntrax error is on the line that says "</script>" any thoughts? Thanks, Kyle |
pandy |
Sep 8 2011, 08:26 PM
Post
#2
|
🌟Computer says no🌟 Group: WDG Moderators Posts: 20,734 Joined: 9-August 06 Member No.: 6 |
I don't know about DW, but debuggers sometimes count lines in peculiar ways.
I move this to the JavaScript forum since that's what it seems to be about. |
newwebseo |
Sep 9 2011, 02:03 AM
Post
#3
|
Advanced Member Group: Members Posts: 125 Joined: 9-October 09 Member No.: 9,984 |
Your code just seems to be fine, I have checked its syntax and everything is just fine.
Only one thing is pinching me that is your cod is of 40 lines then how you are getting syntax error on 41 line Are you sure that you have posted complete code. please check again. |
Darin McGrew |
Sep 9 2011, 03:03 AM
Post
#4
|
WDG Member Group: Root Admin Posts: 8,365 Joined: 4-August 06 From: Mountain View, CA Member No.: 3 |
QUOTE Only one thing is pinching me that is your cod is of 40 lines then how you are getting syntax error on 41 line IME, that usually happens when there is an unclosed quote, or an unclosed parenthesis, or some other unclosed delimiter. The parser realizes there's a problem when it reaches the end of its input, and still has something open. |
pandy |
Sep 9 2011, 09:30 AM
Post
#5
|
🌟Computer says no🌟 Group: WDG Moderators Posts: 20,734 Joined: 9-August 06 Member No.: 6 |
With embedded scripts debuggers' line numbering can be vary strange, especially true for Microsoft's debugger. For all I know that could be what DW uses, don't know.
You could try to run the script in different browsers and use their debug information (you need to turn debugging on first). That could give you more useful information, especially since they all will tell it to you a little differently. That often helps me when the error isn't clear to me. |
Lo-Fi Version | Time is now: 7th May 2024 - 10:16 PM |