Re: 2 questions: Search in array and detect JS

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 4/14/06, Ryan A <Ryan@xxxxxxx> wrote:
> The reason I ask is before serving an AJAX page I would like to make sure JS
> is enabled, if not, serve the other "normal page"... I am sure I am not the
> first person to come accross this little problem, how did you solve it?

Dan eluded to a big problem here, regarding the potential "exit trap"
of redirecting a user to a different page.  However there's even more
at stake--this solution would require you to manage *two* versions of
your page.  Come on, we can do better than that...

What you should do is create your "normal page" as is, and then write
your javascript to "attach" itself to whatever things you want to
AJAXify on that page.  Research "unobtrusive javascript", it should
get you in the right direction.

The idea is, you build your page to function normally without any
javascript.  Then you attempt to hook up the javascript via your
page's onload event (there are other methods too I believe, Google
it).  If javascript is enabled, then the javascript will be hooked in;
if not, then no AJAX will be loaded, but your page will still function
as needed.

HTH,

John W

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux