It is currently Fri May 18, 2012 4:34 pm


Post a new topicPost a reply Page 1 of 1   [ 1 post ]
Author Message
 Post subject: How to detect if the clients browser java script enabled?
PostPosted: Wed Aug 06, 2008 5:21 pm 
Site Admin

Joined: Sat Aug 02, 2008 8:00 am
Posts: 147
Hi
The question is how to know if the clients browser supports java script?

I searched on the internet and found no clue to make the servlet or the scriptlet recognize if the client Java script enabled so I tried to make a workaround

1-First create a div that will contain the content that you would like to show if java script is enabled
Code:
<div id="javascriptdiv" style="visible:none">
some html
</div>

2-Create a Javascript method called checkenabled()
Code:
<script>
function checkenabled()
{
document.getelementbyid("javascriptdiv").style.visible=true;
}
</script>


3-in the body tag put the checkenabled method in the onload attribute
Code:
<body onload="checkenabled()">


doing that will make the div visible only if the java script is enabled in the browser

_________________

Muhammad Safwat Fuad
The Java Code Admin
Java Technical Lead.
Mobile: +2010-2942-538
Email:mtv134@yahoo.com


Top
 Profile Send private message  
 
Display posts from previous:  Sort by  
Post a new topicPost a reply Page 1 of 1   [ 1 post ]


Who is online

Registered users: cypaporesi


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Jump to:  
cron


Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
twilightBB Style by Daniel St. Jules of Gamexe.net

[
SEO MOD © 2007 StarTrekGuide ]