As an example of the code that could be used with the Dynamic Ajax Content script, you could put this on your 'top' page:
Code:
<script type="text/javascript">
(function(){
var q;
function getQval(n) {
if(typeof n !== 'string'){
return null;
}
var r = new RegExp('[?&;]' + n + '=([^&;#]*)'), m = location.search;
return (m = r.exec(m))? unescape(m[1]) : null;
}
if((q = getQval('loadpage'))){
function loadpage(){
q = q.split('::');
ajaxpage(q[0], q[1]);
}
if(window.addEventListener){
window.addEventListener('load', loadpage, false);
}
else if(window.attachEvent){
window.attachEvent('onload', loadpage);
}
}
})();
</script>
Then, and this part is a little tricky because you need to customize it a bit, on your external pages you can put:
Code:
<script type="text/javascript">
location.replace('../index_3col.htm?loadpage=' + encodeURIComponent(location.href + '::centercolumn'));
</script>
<meta http-equiv="refresh" content="0;url=../index_3col.htm?loadpage=ajaxfiles/external3.htm::centercolumn">
Highlighted and red are the path to your 'top' page from the external page. You may use the absolute path here if you like. Highlighted and green is the path to the external page from the top page, this may also be absolute. Highlighted and black are the name of the content area you wish to populate on the top page.
What this will all do is that if someone gets to your external page via a search engine (or any other way other than by loading it into your 'top' page), it will load into the 'top' page, except if they have javascript disabled. In that case it will load the 'top' page, where presumably you will have a noscript tag telling them that "The requested content and/or functionality of this page cannot be achieved without javascript enabled".
Bookmarks