We are all familiar with building AJAX sites that have a 300ms trigger for checking anchors in the URL and then loading the proper page with AJAX. However, these anchor links do not provide any benefit to search engines =(
I have come up with a potential workaround. All JavaScript code remains unchanged, but there is this small adjustment (I'm using JQuery, apologies):
$('a').live("click",function(){
var lnk = $(this).attr("href");
document.location.hash = lnk;
return false;
})
By replacing anchor links in the body with plain links, we can create corresponding plain pages (which still contain all JavaScript codes) for non-JavaScript users and search engines. For regular visitors, we can dynamically convert plain links into hashes on the fly and load AJAX content instantly. Users searching through search engines will be directed to specific pages and can continue navigating with AJAX... somehow (remember, those direct pages still include JavaScript code).
I just want to verify if my assumptions are correct. Are they?
Update: One downside is that when a user directly enters an internal page with an address like /portfolio, they may be redirected to URLs such as /portfolio#contacts which aren't aesthetically pleasing, although they still function correctly (in this example, displaying contacts).