debugging - Cannot debug a javascript issue in Chrome Developer Tools/Firebug -
i have simple javascript syntax error in 1 of pages.
in console chrome developer tools following message:
uncaught syntaxerror: unexpected token ( ... my_file.php(line 1799)
and
failed load resource: net::err_cache_miss
however, cannot inspect page's source. shows in blank, or not loaded.
i looked resource tab, script file , searched affected line. line 1799 has commented instruction:
//location.reload();
it doesn't make sense , not first time had report in chrome find out problem in line or file.
in firebug nothing reported, despite fact javascript not work.
what steps try figure out error coming from?
i tried:
- refreshing page. it's common knowledge script loads after load page second time;
- inspecting file's script in source tab - shows in blank (regardless of how many times refresh);
- inspecting file's script in resources tab - error shows in commented line. line 1799 shows commented instruction;
- inspecting file's script in firebug shows nothing. no errors thrown in script or in console. , yet, javascript not work...
update: fixed err_cache_miss pressing ctrl + f5 (load , delete cache), suggested in thread.
however, syntax error (unexpected closing brackets) still showing up. location of faulty line varies each page refresh, show on lines fine.
update #2: fixed problem. had inspect script lines , gradually fixed syntax errors (which away rows hinted @ chrome).
i still have no idea why firebug did not report me faulty line, or why chrome devtools pointed @ wrong one. part frustrating.
(copied update #2)
i fixed problem. had inspect script lines , gradually fixed syntax errors 1 one (which away rows hinted @ chrome).
while fixing different lines, same line (which apparently looks correct) kept showing error.
then, after fixed particular line, error line 1799 not reported anymore.
i still have no idea why firebug did not report me faulty line, or why chrome devtools pointed @ wrong one. part frustrating.
Comments
Post a Comment