You want to make a website with an AJAX-based navigation to only refresh changes that show the right content? Cool! It will bring a very reactive website.
Problem 2: It also prevents your users from opening this link in a new window or in a new tab :'(
Philosophy of "AJAXed and accessible links"
I will give you a very small and simple implemantation of my links approach which:
- Allows the user to use AJAX on a simple click in the links
- Make a classic navigation (using the
- Make a classic navigation if the user wants to open the link in a new tab or a new window
I choose the following implementation to decide to use a classic navigation if the user clicks on the link with:
- the middle button
- CTRL key pressed
- SHIFT key pressed
In your website design, you have to make all your pages accessible by a link, redering the right state of the page on the server.
SmartLink function in the source file you can download from above. To use it, you have to write your links like that:
<a id="SmartLink1" href="http://www.codeproject.com"
onmousedown="SmartLink(event, this, 'MyAjaxLink1()');">
my smart link 1