You are here: Re: How do I check if javascript is enabled in PHP? « All PHP « IT news, forums, messages
Re: How do I check if javascript is enabled in PHP?

Posted by Juliette on 10/11/73 11:59

Jim wrote:
> How do I check if javascript is enabled in PHP?
>
> TIA,
>
> Jim
>
>


Tim,

Just my two pennies:

Don't use PHP to check for javascript enabled / disabled.

Make your pages function properly without javascript, i.e. don't have
any inline javascript in your page - nothing essential should be done
using javascript.

Then in the pages link in an external javascript file in the header.
In this javascript file use something along the lines of:

window.onload = init;

function init() {
// add any javascript functions to the page using the DOM
}


This way, your users can use your site independently of whether
javascript is enabled or disabled as the javascript is only 'added' if
the user has javascript enabled.

An elegant and user-friendly way to deal with the problem.

Good luck,
Juliette

P.S.: if none of the above makes sense to you, stay away from javascript
in the first place.

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация