简体   繁体   中英

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


is there any concern of adding javascript code at the very beginning of opening tag of body?
does it affect SEO??

Thanks for your help

,但是出于速度考虑,我建议将其插入身体的末端。

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

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.

是的 ,因为速度对于搜索引擎而言是直接和间接的(通过使用情况指标)重要的性能指标。

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM