I have a web page that implements a set of tabs, each tab showing different content. The click of the tab does not refresh the page, but hides/shows the content on the client side.
There is now a requirement to change the page title based on the tab selected on the page (for SEO reasons). Is this possible? Can someone provide a solution to dynamically modify the page title via javascript without reloading the page?
I want to say hello to you from the future :) Recent events:
So, to answer your question, you can safely change the title and other meta tags via javascript (if you want to support non-Google search engines, you can also add something likehttps://prerender.iostuff), just make them accessible as separate URLs (otherwise how would Google know they are different pages and show them in search results?). Changing SEO-related tags after a user clicks on something is simple:
Just make sure you don't block CSS and javascript from loading in robots.txt, and you can use theFetch as Googleservice in Google Webmaster Tools.
1:http://searchengineland.com/tested-googlebot-crawls-javascript-heres-learned-220157
UPDATE: Based on comments and references onSearchEngineLand, most web crawlers will index the updated titles. The answer below is outdated, but the code still applies.