简体   繁体   中英

window.location and SEO

I'm trying to use something like jQuery biggerlink or just simple window.location for making bigger and more accessible links. What I'm wondering is what happens with SEO in these cases — I have anchor link in the containing element, but does Google penalize such actions since I'm not really clicking on link. Also, are there any other solutions (besides CSS positioning) which could be better than this one? Thanks.

Setting window.location from script will not be spotted by search engines (Google has detection for simple document.write additions but this won't catch any of the more advanced DOM scripting stuff). It's also bad for usability: all the usual browser controls you get for links, like middle-click-for-new-tab, right-click-copy-location or bookmark stop working.

biggerlink avoids the SEO issue by keeping the correct <a href> markup in the HTML, and adding extra click handling over the top of that. (The 'bigger' parts of the biggerlinks still don't respond to eg. middle-click, but the 'native' parts do.) As long as you keep <a href> in an appropriate place you don't have to worry about search engines.

I'm not at all sure this stuff is necessary. The effects I've seen biggerlink do could easily be done using links with 'display: block;' and occasional workarounds like multiple links when you want to do things like headings inside the links. Sure it's a little more markup, but it's a lot less scripting and then all links respond in the expected way links usually do.

This doesn't have similarly completion and code syntax to the Meta Refresh tag, although they perform alike wherever the Meta tag refresh and the JavaScript redirect occurs on the customer surface, sense at the web browser point.

<script type="text/javascript"> window.location = "http://www.example.com/path/file.html" </script>

This can be located wherever inside the HTML basis code and is most likely used more than Meta tag Refresh for encoding purpose delays seeing as in JavaScript you can make use of a lot additional other scripting include the window.location function. While this isn't best for SEO as search engines usually ignore JavaScript code. In the recent years, Google reads javascript and talk about it's headlell browser technology including GoogleBot crawling.

Search engines generally don't interpret JavaScript, they just read what your HTML markup says. So your SEO attempts will be overlooked.

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