473,761 Members | 8,651 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

check javascripr enable/disable

I want to check through perl whether javascript is enabled or disabled
in mozilla browser. If it is disabled I want to display a message to
user to enable it. What code can I use please help.

I tried "navigator.java Enabled() but it is in javascript again. If
javascript will be disabled so browser can neither read this code
even.

Thanks

Jul 30 '07 #1
6 3322
Anshul said the following on 7/30/2007 5:30 AM:
I want to check through perl whether javascript is enabled or disabled
in mozilla browser. If it is disabled I want to display a message to
user to enable it. What code can I use please help.

I tried "navigator.java Enabled() but it is in javascript again.
navigator.javaE nabled() tells you whether Java is enabled or not, not
whether JS is enabled or not.
If javascript will be disabled so browser can neither read this code
even.
<noscript>Pleas e enable scripting in your browser</noscript>

--
Randy
Chance Favors The Prepared Mind
comp.lang.javas cript FAQ - http://jibbering.com/faq/index.html
Javascript Best Practices - http://www.JavascriptToolbox.com/bestpractices/
Jul 30 '07 #2
Anshul wrote:
I want to check through perl whether javascript is enabled or disabled
in mozilla browser.
You would need to use client-side scripting to submit an HTTP request
that is handled by the server-side Perl script if client-side script
support is enabled. For example:

<script type="text/javascript">
var img = new Image();
img.src = "http://foo.example/bar.pl?js=1";
</script>

Or, for another example, you could use XMLHttpRequest/IXMLHTTPRequest
for that. All solutions (have to) use a host object, and neither one is
guaranteed to be supported.
If it is disabled I want to display a message to
user to enable it. What code can I use please help.
Not possible using a server-side script without prior user interaction,
since it can only "know" when client-side script support is enabled as
the former has to be "notified" by the latter.
I tried "navigator.java Enabled() but it is in javascript again. If
javascript will be disabled so browser can neither read this code
even.
You don't need any programming:

<noscript>... </noscript>

However, your approach is most likely wrong. Websites should work
without client-side script support.
PointedEars
Jul 30 '07 #3
Thomas 'PointedEars' Lahn said the following on 7/30/2007 5:49 AM:
Anshul wrote:
>I want to check through perl whether javascript is enabled or disabled
in mozilla browser.

You would need to use client-side scripting to submit an HTTP request
that is handled by the server-side Perl script if client-side script
support is enabled. For example:

<script type="text/javascript">
var img = new Image();
img.src = "http://foo.example/bar.pl?js=1";
</script>

Or, for another example, you could use XMLHttpRequest/IXMLHTTPRequest
for that.
Or, redirect using JS.

--
Randy
Chance Favors The Prepared Mind
comp.lang.javas cript FAQ - http://jibbering.com/faq/index.html
Javascript Best Practices - http://www.JavascriptToolbox.com/bestpractices/
Jul 30 '07 #4
On Jul 30, 3:09 pm, Randy Webb <HikksNotAtH... @aol.comwrote:
Anshul said the following on 7/30/2007 5:30 AM:
I want to check through perl whether javascript is enabled or disabled
in mozilla browser. If it is disabled I want to display a message to
user to enable it. What code can I use please help.
I tried "navigator.java Enabled() but it is in javascript again.

navigator.javaE nabled() tells you whether Java is enabled or not, not
whether JS is enabled or not.
If javascript will be disabled so browser can neither read this code
even.

<noscript>Pleas e enable scripting in your browser</noscript>

--
Randy
Chance Favors The Prepared Mind
comp.lang.javas cript FAQ -http://jibbering.com/faq/index.html
Javascript Best Practices -http://www.JavascriptT oolbox.com/bestpractices/
Thanks Randy,

It helped me.

Bye

Jul 30 '07 #5
Randy Webb wrote:
Thomas 'PointedEars' Lahn said the following on 7/30/2007 5:49 AM:
>Anshul wrote:
>>I want to check through perl whether javascript is enabled or disabled
in mozilla browser.
You would need to use client-side scripting to submit an HTTP request
that is handled by the server-side Perl script if client-side script
support is enabled. For example:
[...]
Or, redirect using JS.
Which could break the Back button.
PointedEars
Jul 30 '07 #6
On Jul 30, 2:30 am, Anshul <anshul...@gmai l.comwrote:
I want to check through perl whether javascript is enabled or disabled
in mozilla browser. If it is disabled I want to display a message to
user to enable it. What code can I use please help.

I tried "navigator.java Enabled() but it is in javascript again. If
javascript will be disabled so browser can neither read this code
even.

Thanks
There are many messages in the archives of this newsgroup describing
why a check for JavaScript being enabled or not is insufficient. This
will not tell you if you scripts will run successfully.

<URL: http://www.jibbering.c om/faq/faq_notes/not_browser_det ect.html>

Peter

Jul 30 '07 #7

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
3759
by: vncntj | last post by:
i want to enable one listbox and disable the other depending on if i check winter_gala (checkbox) here is my code. <script type="text/javascript"> function check() { if (document.forms.winter_gala.checked=true) { document.forms.winter_gala.young_friend_list.disabled=true
2
3459
by: eddie wang | last post by:
Hello, I inherited an Access application from a previous coworker. It seems the Spell Check is never enabled unless I open the application by holding down the shift key and double clicking the application icon at the same time. How can I enable the spell check all the time? I saw some code posted by Terry Wickenden in this newsgroup. unfortunately his code didn't work for me.
3
3799
by: DBQueen | last post by:
I have a form with lines of controls. On some of the lines there are 3 controls (call them A,B,C); other lines have only control A. The controls have been numbered sequentially (Q20, Q21....Q76) and they were put onto the form in the numerical sequence. I have given the A's with B & C's on the same line a tag=1; B.tag=2, C,tag=2) I am trying to write 2 modules so that the following occurs (on Form_Current and 'A' Control_Before or...
0
2422
by: talal | last post by:
How to check whether javascript is enable or disable in client browser. Remeber i can check wheter browser client support javascript with BrowserCapability class. But what if the client has disable from security setting in a browser. Tell me is there any class like browserCapability in asp.net to check wheter javascript is enable or disable. Please dont tell me the html way or do some javascript because i have to apply this code into...
10
2096
by: Just Me | last post by:
If I periodically check to see if the floppy is ready, the drive will each time make a little noise. I've been up against this before and could never find a way to check to see if the floppy drive is ready without making the drive make that grinding noise. Does anyone know a way? Thanks in advance
4
3688
by: John Salerno | last post by:
My code is below. The main focus would be on the OnStart method. I want to make sure that a positive integer is entered in the input box. At first I tried an if/else clause, then switched to try/except. Neither is perfect yet, but I was wondering which I should try for in the first place. I figure I need to check for an emptry string, non-numeric strings (maybe these are the same check), 0 and negative numbers (which might also fall into...
8
34458
by: rongchaua | last post by:
Hi all, i would like now to disable and enable network adapter programmatically with c#. I have searched but found nothing useful. There's no topic about this problem. Has someone done with this problem? All help will be appreciated. rongchaua.
3
11661
by: Pietro | last post by:
Hi all, First of all I'd like to thank you very very much ,as finally after many years of searching,I could find a code to disable/enable the shift key,but actually i cannot use the code as I'm very new to VBA,i tried to follow the instructions reported in the code,but i got no result,i still can use the shift key,can you explain in details how to use it correctly to enable/disable users from pressing shift key to view database windw?,the...
3
4857
by: thirish | last post by:
Hi, I have jsp page, on jsp page, The data is displaying from xml island. the Requriement is i have optional button and dropdown in each row. if user check the option button in second row then second row dropdown should be enable. if uncheck then dropdown should be disable. Any body help in this case. In jsp page i will get more than two row. let me know if any more requriments. Thanks, Tirish
0
9531
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9957
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
9905
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9775
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8780
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
6609
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5229
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5373
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3881
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.