That (outdated) script doesn't allow you to do what you want.
Generally speaking, Ajax scripts do not handle the browser's history and URLs within the address bar 'correctly'.
An option would be to use an iframe instead. Try to experiment with the following, which uses location.search for links in index.html, and parent.location.search in the iframed pages:
index.html:
Code:
<!doctype html>
<html >
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>bla</title>
<style>
body {font-family: verdana; font-size: 13px; }
</style>
</head>
<body >
<div style="position: absolute; top: 45%; left: 10px">
<a href="javascript: void(0)" onclick="location.search='about.html'">About</a><br>
<a href="javascript: void(0)" onclick="location.search='contact.html'">Contact</a><br>
<a href="javascript: void(0)" onclick="location.search='http://www.dynamicdrive.com'">DynamicDrive</a><br>
</div>
<div style="position:absolute; left:200px; top: 10%; right: 200px; bottom: 10%">
<iframe name="ifr" style="position:absolute; width: 100%; height: 100%; background: white; border: 1px solid silver" src="http://www.dynamicdrive.com" frameborder="0"></iframe>
</div>
<script>
if(location.search)ifr.location.replace(location.search.substring(1))
</script>
</body>
</html>
about.html:
Code:
<!doctype html>
<html >
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>bla</title>
<script>
function orph(){//dont't allow iframed pages to show as 'orphans' (without the main page). The main page is called 'index.html' here
if (parent.location == self.location)
parent.location.href="index.html?" + document.URL.substr(document.URL.lastIndexOf("/")+1,document.URL.length)
}
if ( typeof window.addEventListener != "undefined" )
window.addEventListener( "load", orph, false );
else if ( typeof window.attachEvent != "undefined" )
window.attachEvent( "onload", orph );
else {
if ( window.onload != null ) {
var oldOnload = window.onload;
window.onload = function ( e ) {
oldOnload( e );
orph();
};
}
else
window.onload = orph;
}
</script>
</head>
<body>
<h1 style="text-align: center">About</h1>
<a href="javascript: void(0)" onclick="parent.location.search='about.html'">About</a><br>
<a href="javascript: void(0)" onclick="parent.location.search='contact.html'">Contact</a><br>
<a href="javascript: void(0)" onclick="parent.location.search='http://www.dynamicdrive.com'">DynamicDrive</a>
</body>
</html>
contact.html:
Code:
<!doctype html>
<html >
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>bla</title>
<script>
function orph(){//dont't allow iframed pages to show as 'orphans' (without the main page). The main page is called 'index.html' here
if (parent.location == self.location)
parent.location.href="index.html?" + document.URL.substr(document.URL.lastIndexOf("/")+1,document.URL.length)
}
if ( typeof window.addEventListener != "undefined" )
window.addEventListener( "load", orph, false );
else if ( typeof window.attachEvent != "undefined" )
window.attachEvent( "onload", orph );
else {
if ( window.onload != null ) {
var oldOnload = window.onload;
window.onload = function ( e ) {
oldOnload( e );
orph();
};
}
else
window.onload = orph;
}
</script>
</head>
<body>
<h1 style="text-align: center">Contact</h1>
<a href="javascript: void(0)" onclick="parent.location.search='about.html'">About</a><br>
<a href="javascript: void(0)" onclick="parent.location.search='contact.html'">Contact</a><br>
<a href="javascript: void(0)" onclick="parent.location.search='http://www.dynamicdrive.com'">DynamicDrive</a>
</body>
</html>
Note:
In the example above, the starting page (in the iframe, index.html) is DynamicDrive. Of course, you would choose a page of your own instead, for instance about.html
Bookmarks