开发者

does inserting javascript code at the beginning of the body affect SEO?

开发者 https://www.devze.com 2023-02-04 06:25 出处:网络
is there any concern of adding javascript code at the very beginning of opening tag开发者_如何学JAVA of body?

is there any concern of adding javascript code at the very beginning of opening tag开发者_如何学JAVA of body?

does it affect SEO??

Thanks for your help


No, but for reasons of speed I suggest to insert it at the end of the body.


Why don't you put it in the head section so it's all loaded up for you before the page renders? In my experience, the more code you just randomly litter in the body of the HTML page, the more likely there will be conflicts, especially if one subset of JavaScript requires another subset to load or run first.

Of course, if you must put the code in the body, the best place is right before the closing body tag. Sometimes this is necessary.


The best place to put it is at the end, as page rendering blocks when loading JS. Mind you that the Google crawler won't care but your users will


Yes, because speed is a direct and indirect (via usage metrics) important performance factor for the search engines.


It depends which script, it is recommended to put it at the end to increase load times, but if it is a "low weight" script and it is important to you you can put it on the top and check the load time , if you are still in the "green" area then it is OK. If your site will take 0.5 sec longer to load it will not crash all your SEO efforts.

0

精彩评论

暂无评论...
验证码 换一张
取 消