Welcome to WebmasterWorld Guest from 22.214.171.124
Forum Moderators: open
If I have a PILE of java sript in an external file ie x.js, which is called from my html code via:
Will a spider travel to x.js and try to index what it finds in there or will the spider only see the code within the html file itself.
I am new to seo and am trying to learn how to minimize my html code size.
here's a link:
First off, thankyou for answering my question and for the code advise. Secondly, why would anyone want to hide their java script and/or include external .js files as opposed to just embedding all the java code within the html code, if a spider is not going to index it anyway?
Putting your js code in an external file keeps the html size to a minimum.
Another advantage is that visitors will experience faster page loads as they move around your site. The first time they view a page that includes the file, the loading time will be whatever it needs to be, but subsequent pages will load a bit faster because the .js file will already be in cache.