Updating web pages dynamically

Since search engines ignore most javascript, you will need to make it so that search engines can crawl using the tabs without using Ajax.

Make each tab a link with an href that loads the entire page with that tab selected. The onclick event handler can still load the pages via ajax for human viewers.

I would also go ahead and make that tab the "active" one.

Once the page is loaded and an actual user is switching tabs you would use javascript to change However, this is more complex since you are showing and hiding tabs without refreshing the page or changing the URL.

I have a webpage that implements a set of tabs each showing different content.

The tab clicks do not refresh the page but hide/unhide contents at the client side.

You would need to have server side processing to parse the url and set the initial page title when the browser renders the page.

One thing you can be sure of, though, is that it will annoy other developers if they see to go with is the latter method.

This property is provided in the DOM Specification specifically for the purpose of, as the name suggests, changing the title.

So make sure the page reload works first then add document.title changes I just want to add something here: changing the title via Java Script is actually useful if you're updating a database via AJAX, so then the title changes without you having to refresh the page.

The title actually changes via your server side scripting language, but having it change via Java Script is just a usability and UI thing that makes the user experience more enjoyable and fluid.

Leave a Reply