Page 1 of 1

My idea how to use ajax nav and give non-js support

Posted: Tue Jan 02, 2007 8:57 am
by wildwobby
I just came up with an idea of how to make AJAX load page content but if the user doesnt support javaScript have it load the whole page..

Heres an example link on one page which will use AJAX to load just the content of content1.php or if the user doesnt support Js, will reload the whole page again...
processajax() is a function i made to process the ajax (serverpage, container).

Code: Select all

<html>
<head>
</head>
<body>
<div id="header">
// header image here.
</div>
<a href="content1.php" onclick= "processajax('content1.php','content') return false;">Content page 1</a>
<div id="content"></div>
</body>
</html>
Here is an example content of content1.php

Code: Select all

<noscript>
<html>
<head>
</head>
<body>
<div id="header">
//header stuff here/
</div>
<div id="content">
</noscript>
<p>Lorem ipsum dolor sit amet...</p>
<noscript>
</div>
</body>
</html>

Posted: Tue Jan 02, 2007 9:14 am
by Chris Corbyn
Is this a question? That's the standard way to provide a fallback yes =)

...

Posted: Wed Jan 03, 2007 7:14 pm
by wildwobby
So it would be as efficient for the app to do that than to use GET vars in php to display part of the content for ajax retreival or all of it for client retreival? does the ajax not even send the stuff within the <noscript>