RE: 2 questions: Search in array and detect JS

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

 



How about

<?php $js = true; ?>

<noscript>
	<?php $js = false; ?>
</noscript>

<?php
if ($js)	{
	// whizzy Ajax code (or file include)
} else {
	// generic warning (or include non-JS base file)
}
?>

I know that would work but does it give the desired effect?

Dan

 
-------------------
http://chrome.me.uk
 

-----Original Message-----
From: tedd [mailto:tedd@xxxxxxxxxxxx] 
Sent: 15 April 2006 15:10
To: Chrome; 'Ryan A'; 'php'
Cc: '"Stut"'
Subject: RE:  2 questions: Search in array and detect JS

>Something to consider might be:
>
><noscript>
>Sorry! This page requires Javascript to function properly! Please enable it
>or get a decent browser
></noscript>
>
><!-- Normal page functions -->
>
>I haven't tested it so there is a chance it's fiction :)
>
>Of course, if web standards aren't a concern it makes no difference
>
>Dan


It works and if you want it to validate, just enclose the paragraph 
in <p></p>, like so:

<noscript>
<p>
Sorry! This page requires Javascript to function properly! Please enable it
or get a decent browser.
</p>
</noscript>

To bad that php within those tags is read regardless or we would have 
an easy way to detect js.

tedd
-- 
----------------------------------------------------------------------------
----
http://sperling.com

__________ NOD32 1.1490 (20060415) Information __________

This message was checked by NOD32 antivirus system.
http://www.eset.com

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