final ; in javascript required?

Discussion about any web related scripting languages like JavaScript, ASP, and PHP.
Post Reply
flashbrack
Rank 0 - Newcomer
Rank 0 - Newcomer
Posts: 1
Joined: Wed Sep 28, 2011 10:07 pm

final ; in javascript required?

Post by flashbrack » Wed Sep 28, 2011 10:28 pm

I am new to the CSE HTML validator (very impressed with it), also an amateur web designer. So excuse me if this is a naive question.

I have a javascript function as below on my frameset index.htm page. (Yes I know frames are now deprecated and will eventually switch to iframes).

<script type="text/javascript">
var fname="main"; //MAIN CONTENT AREA FRAME **NAME**
window.onload=function(){
var d=document.location.search;
if(d!=='')top.frames[fname].document.location.href=d.substring(d.lastIndexOf('?')+1,d.length);
};
</script>

Which I found on the web to handle redirection to a requested page after reloading the frameset, when the page has been addressed directly.

My question regards the final ";" after the function's closing "}", which I added to satisfy the javascript lint component of CSE validator pro. It seems non-standard, why is it required? The script works fine with it or without it. I have been unable to find a reference to this syntax on the W3C site.

Not a big deal, just curious.

User avatar
Albert Wiersch
Site Admin
Site Admin
Posts: 3347
Joined: Sat Dec 11, 2004 9:23 am
Location: Near Dallas, TX
Contact:

Re: final ; in javascript required?

Post by Albert Wiersch » Thu Sep 29, 2011 8:37 am

Hello,

I tried to reproduce this but couldn't get JavaScript Lint to produce any messages at all, other than the "[JavaScript Lint] 0 error(s), 0 warning(s)" one. Can you supply a full document that reproduces the problem? Have you changed any JavaScript Lint options from the default?

Thank you.
Image
Albert Wiersch

Post Reply