I have a couple of links in navigation on homepage that lead to new pages. When clicked on link, i want to prevent going on that page (e.preventDefault()), and instead load that page in popup with ajax. JS disabled users would go to the page from link. Can this hurt SEO in any way? Would those pages get crawled?

2 Answers 2


The pages will be found and most likely be crawled. You're not far from the truth if you assume bots don't use Javascript.

A crawler works similar to this:

  1. Go to a webpage and get it's contents
  2. Get all the information from the page, like keywords and all other SEO checks
  3. Get all internal and external links from the source
    • Per link, go to step 1.

It takes the source, not the page the user sees. Some bots do excecute some javascript, but it won't stop them finding and crawling the urls.

If you want bots not to follow the urls on a page, there is NOINDEX (says: Do not index this page) and NOFOLLOW (index this page, but don't follow the urls. More information about the robots meta.

Another option is to use robots.txt, a small textfile where you can add url's to pages you don't want them to index. This does depend on trusting they'll actually listen to it (but they most commonly do).

  • Thanks for your answer. I actually want them to get crawled. I was concerned that they may be blocked from crawling if bot reads javascript and see that default action is prevented. Commented Jun 12, 2015 at 21:02

Google suggests to use the "HistoryAPI". Add this line, together with the preventDefault().

window.history.pushState({}, window.title, hrefUrl) // Update URL as well as browser history.



Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.