td22: JavaScript Code evaluieren

Beitrag lesen

Hmm, ist das normal, dass das Ergebnis so aussieht:

Problem at line 7 character 31: Statement on line 25: Cannot convert undefined or null to Object Backtrace: Line 25 of linked script http://jslint.com/webjslint.js: In function it function it(type,value){var i,t;if(type==='(color)'){t={type:type};}else if(type==='(punctuator)'||(type==='(identifier)'&&syntax.hasOwnProperty(value))){t=syntax[value];if(!t.id){t=syntax[type];}}else{t=syntax[type];} Line 90 of linked script http://jslint.com/webjslint.js return it('(punctuator)',t);}}}} Line 116 of linked script http://jslint.com/webjslint.js: In function advance prevtoken=token;token=nexttoken;for(;;){nexttoken=lookahead.shift()||lex.token();if(nexttoken.id==='(end)'||nexttoken.id==='(error)'){return;} Line 288 of linked script http://jslint.com/webjslint.js: In function doTag break;case'script':xmode='script';advance('>');indent=nexttoken.from;if(a.lang){warning("lang is deprecated.",token);} Line 318 of linked script http://jslint.com/webjslint.js: In function html doTag(n,attributes);if(!e){stack.push(t);} Line 431 of linked script http://jslint.com/webjslint.js indent=0;global=Object.create(predefined);scope=global;funct={'(global)':true,'(name)':'(global)','(scope)':scope,'(breakage)':0,'(loopage)':0};functions=[];ids={};urls=[];src=false;xmode=false;stack=null;member={};membersOnly=null;implied={};inblock=false;lookahead=[];jsonmode=false;warnings=0;lex.init(s);prereg=true;prevtoken=token=nexttoken=syntax['(begin)'];assume();try{advance();if(nexttoken.value.charAt(0)==='<'){html();if(option.adsafe&&!adsafe_went){warning("ADsafe violation: Missing ADSAFE.go.",this);}}else{switch(nexttoken.id){case'{':case'[':option.laxbreak=true;jsonmode=true;jsonValue();break;case'@':case'*':case'#':case'.':case':':xmode='style';advance();if(token.id!=='@'||!nexttoken.identifier||nexttoken.value!=='charset'){error('A css file should begin with @charset "UTF-8";');} Line 466 of linked script http://jslint.com/webjslint.js d.toGMTString();JSLINT(input.value,op);output.innerHTML=JSLINT.report();input.select();return false;} ...

Finde das ehrlich gesagt eher verwirrend als hilfreich ;) Wahrscheinlich liegt's daran, dass ich mich nicht so gut ausgedrückt habe. Ich suche etwas, dass in einer HTML-Datei mit JavaScript Elementen das JavaScript verifziert ...

Andreas