faqts : Computers : Programming : Languages : JavaScript

+ Search
Add Entry AlertManage Folder Edit Entry Add page to http://del.icio.us/
Did You Find This Entry Useful?

0 of 2 people (0%) answered Yes
Recently 0 of 2 people (0%) answered Yes

Entry

How can i detect that browser enabled javascript thru javascrript code or thru any langauge code

Apr 8th, 2008 19:02
ha mo, Dave Clark, rana Krishnraj,


~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Rana,
     The only solution I've seen, for this, is to make your default 
index page without JavaScript except for the following small amount -- 
which immediately navigates to the default version of the same page 
(in a different folder) which contains full JavaScript.
<script type="text/javascript">
<!--//
self.location.href = "/script/";
//-->
</script>
     Thus, the default site folder would be compeltely devoid of 
JavaScript except for the default index page.  The script folder would 
have duplicate versions of all pages except with full JavaScript code 
embeded within those versions.
     Of course, this also means that search engines won't index the 
script versions of your pages and will only point to the non-script 
versions of your pages.  Presumably this would be OK if you wanted to 
also place the above code in every non-script page and customize it to 
point to the equivalent page in the script folder.
     By the same token, of course, you could reverse this process and 
make your default page be full script and use the following code to 
redirect to a non-script version of the same page:
<noscript>
<meta http-equiv="refresh" content="0;url='/nscr/'">
</noscript>
Take care,
Dave Clark
www.DaveClarkConsulting.com
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
http://www.businessian.com
http://www.computerstan.com
http://www.financestan.com
http://www.healthstan.com
http://www.internetstan.com
http://www.moneyenews.com
http://www.technologystan.com
http://www.zobab.com
http://www.healthinhealth.com