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

JavaScript and client side scripting.

Moderator: General Moderators

Post Reply
wildwobby
Forum Commoner
Posts: 66
Joined: Sat Jul 01, 2006 8:35 pm

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

Post 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>
User avatar
Chris Corbyn
Breakbeat Nuttzer
Posts: 13098
Joined: Wed Mar 24, 2004 7:57 am
Location: Melbourne, Australia

Post by Chris Corbyn »

Is this a question? That's the standard way to provide a fallback yes =)
wildwobby
Forum Commoner
Posts: 66
Joined: Sat Jul 01, 2006 8:35 pm

...

Post 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>
Post Reply