开发者

Will search engines try to follow a javascript type of address link?

开发者 https://www.devze.com 2023-03-04 06:12 出处:网络
I have the following on my page: <a href=\"javascript:void(0)\" onclick=\"doCheck(\'test\'); return false;\" class=\"btn\">Test</a>

I have the following on my page:

<a href="javascript:void(0)" onclick="doCheck('test'); return false;" class="btn">Test</a>

It works great but now I'm wondering what will happen when it is seen by a se开发者_如何学编程arch engine. Will the search engine try to click the address and follow it?


Google will just ignore it.

It's bad practice to use onClick in that way though, and using the void statement is pretty horrible too.

Have a look at Why is using onClick() in HTML a bad practice? for an explanation of why.

0

精彩评论

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

关注公众号