Re: Javascript parser
"Douglas Crockford" <nospam@covad.n et> wrote in message
news:62432$422b 3e69$436564ee$2 5426@msgid.mega newsservers.com ...[color=blue]
>
> 10000 might be a bit of a download. JSLINT now lists all member names.
> Please try it. Let me know if it is useful, or if more is required.
>
> http://www.crockford.com/javascript/jslint.html[/color]
Despite my post length, I'm actually not very opinionated on the matter.
But I did go check it out, and it failed on this small piece of web page:
<html><body onLoad="tryit() " id=myBody>
<script type='text/javascript'>
// just say no to long function names
// elem = document.getEle mentById; // didn't work on Firefox
var elem = function (myId) {return document.getEle mentById(myId); }
function tryit() {alert (elem('myBody') .id);}
</script></body></html>
It didn't like that there was no semicolon after the function
(on the var elem line). I put the ';' in and then it passed, but
I thought in case you hadn't run across this type of construct,
you might want to know.
Also, perhaps I don't get something. When I changed capitalization
on .getElementById , then Members listed the new capitalization
but I thought it would be in red or something to alert me to a
capitalization discrepency. Did I miss something?
Regards,
Csaba
"Douglas Crockford" <nospam@covad.n et> wrote in message
news:62432$422b 3e69$436564ee$2 5426@msgid.mega newsservers.com ...[color=blue]
>
> 10000 might be a bit of a download. JSLINT now lists all member names.
> Please try it. Let me know if it is useful, or if more is required.
>
> http://www.crockford.com/javascript/jslint.html[/color]
Despite my post length, I'm actually not very opinionated on the matter.
But I did go check it out, and it failed on this small piece of web page:
<html><body onLoad="tryit() " id=myBody>
<script type='text/javascript'>
// just say no to long function names
// elem = document.getEle mentById; // didn't work on Firefox
var elem = function (myId) {return document.getEle mentById(myId); }
function tryit() {alert (elem('myBody') .id);}
</script></body></html>
It didn't like that there was no semicolon after the function
(on the var elem line). I put the ';' in and then it passed, but
I thought in case you hadn't run across this type of construct,
you might want to know.
Also, perhaps I don't get something. When I changed capitalization
on .getElementById , then Members listed the new capitalization
but I thought it would be in red or something to alert me to a
capitalization discrepency. Did I miss something?
Regards,
Csaba
Comment