freelance84 Posted May 17, 2012 Share Posted May 17, 2012 I'm a little confused as to how google and other search engines will respond to this... <a href="blog/some_stuff.html">some stuff</a> The above link is a basic link to a target. My understanding is that google will follow the link and cache the target accordingly. However what will happen when i place some javascript event listeners on the link. Something that would say, display the contents of the target in a div overlay on the same page the link resides. Would google still be able to follow and cache the link? Or would google simply ignore the link completely thus not really caching the target at all? I am trying to achieve an ajax type effect on a blog but still have each post on the blog be its own html entity... thus if google or someone did go a specific blog post the link would still work in its own right and have content. Quote Link to comment https://forums.phpfreaks.com/topic/262654-googles-response-to-js-altered-links/ Share on other sites More sharing options...
smoseley Posted May 17, 2012 Share Posted May 17, 2012 Honestly not sure, but this is relatively common practice, so I wouldn't imagine it's gonna hurt you. Quote Link to comment https://forums.phpfreaks.com/topic/262654-googles-response-to-js-altered-links/#findComment-1346232 Share on other sites More sharing options...
ignace Posted May 17, 2012 Share Posted May 17, 2012 It's possible that Google SE reads HTML and executes JS just like a browser does (except there will be no UI). In most cases this also means it follows the correct path (fallback to href when onclick does not return something usable for example). Quote Link to comment https://forums.phpfreaks.com/topic/262654-googles-response-to-js-altered-links/#findComment-1346257 Share on other sites More sharing options...
kicken Posted May 17, 2012 Share Posted May 17, 2012 The general rule of thumb is that search engines do not understand Javascript and as such it has no effect on your page when crawled. So as long a you have your href pointing to the desired url instead of doing something stupid like href="javascript:blah();" then they will follow it properly. I believe google (and maybe some others these days) do support some limited javascript now, basically just enough to catch redirects and some of the basic stupidities that some webmasters do (ie, <a href="javascript:void();" onclick="location.href='whatever.html'">). There's a chance google might process your onclick but when it sees that your making an ajax request for a URL it will add that URL into it's crawler queue so you should be ok either way. Quote Link to comment https://forums.phpfreaks.com/topic/262654-googles-response-to-js-altered-links/#findComment-1346270 Share on other sites More sharing options...
freelance84 Posted May 18, 2012 Author Share Posted May 18, 2012 Yea I have noticed some sites i have made with ajax content is getting cached by google.. this was my worry: That google would mess up on the "blog links". Thanks. I will build something on the premise that google will cache the actual targets and see what the results are. Quote Link to comment https://forums.phpfreaks.com/topic/262654-googles-response-to-js-altered-links/#findComment-1346605 Share on other sites More sharing options...
Alex Posted May 18, 2012 Share Posted May 18, 2012 Google's getting really good with this type of stuff. Here's a blog post from just a few days ago on this: http://swapped.tumblr.com/post/23133779276/google-bot-now-crawls-arbitrary-javascript-sites Quote Link to comment https://forums.phpfreaks.com/topic/262654-googles-response-to-js-altered-links/#findComment-1346700 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.