javascript - Googlebots causes JS errors, should I care? -
on production server, watch js errors , send server:
<script type="text/javascript"> window.onerror=function(msg,url,line) { if (window.xmlhttprequest) { var xmlhttp = new xmlhttprequest(); } else { var xmlhttp = new activexobject('microsoft.xmlhttp'); } xmlhttp.open('post', '/logjserrorshere', true); xmlhttp.setrequestheader('content-type', 'application/x-www-form-urlencoded'); xmlhttp.send('msg='+encodeuricomponent(msg)+'&url='+encodeuricomponent(url)+'&line='+line); return true; }</script>
and logs "mysterious" errors: "$ not defined", of them comes "googlebot(at)googlebot.com" or spiderbot. should deal it?
depends :) if site readable , indexable out javascript (and site visible in search) wouldn't worry it, unless feel error indicative of bigger issue. can test using fetch , render in google webmaster tools.
if site relies on javascript render page (i.e. uses angularjs example) yes, fix it.
Comments
Post a Comment