phpcook's Avatar
phpcook 4
21 Asked
34 Answered
1 Best
0
No one has voted on this question yet :(
3 years, 4 months ago

How to get the browser javascript enable or not using php/javascript?

hi experts,how to detect the browser javascript options enable or disable using php or javascript code . not via brower through code only please give some tips
Tip for best answer: M$0.00
Separate topics with commas, or by pressing return. Use the delete or backspace key to edit or remove existing topics.

You can leave an optional "tip" with Mahalo's virtual currency, Mahalo Dollars. If you are asking a difficult question that might require some research, or if you'd like a wide variety of feedback, a higher tip often leads to more answers to your question.

M$

What is Your Answer?

0
0
0

3 Answers

1
epascarello's Avatar
epascarello | 3 years, 4 months ago
4
There is no fool proof way to detect it.

The one method is to use JavaScript to set a hidden form field with a value. When the page is submitted, you check that value and you can know JavaScript is enabled if it is there.

What is the main purpose of needing to know if JavaScript is enabled?

You can leave an optional "tip" with Mahalo's virtual currency, Mahalo Dollars. If you are asking a difficult question that might require some research, or if you'd like a wide variety of feedback, a higher tip often leads to more answers to your question.

M$

Report Abuse

Post Reply Cancel
1
answerman's Avatar
answerman | 3 years, 4 months ago
4
You could incorporate a bit of AJAX into the script that calls back to some script on your server. If that script gets called, then you know Javascript is enabled for that browser.

You can leave an optional "tip" with Mahalo's virtual currency, Mahalo Dollars. If you are asking a difficult question that might require some research, or if you'd like a wide variety of feedback, a higher tip often leads to more answers to your question.

M$

Report Abuse

Post Reply Cancel
-1
bvienneau's Avatar
bvienneau | 3 years, 4 months ago
4
get_browser i believe is what you are looking for.

get_browser — Tells what the user's browser is capable of.

Description

get_browser ([ string $user_agent [, bool $return_array ]] )
Attempts to determine the capabilities of the user's browser, by looking up the browser's information in the browscap.ini file.


Here is the link with the information:

http://ca.php.net/get_browser

I hope this helps

You can leave an optional "tip" with Mahalo's virtual currency, Mahalo Dollars. If you are asking a difficult question that might require some research, or if you'd like a wide variety of feedback, a higher tip often leads to more answers to your question.

M$
answerman's Avatar
answerman | 3 years, 4 months ago Report

get_browser only shows a browser's *potential*, without necessarily indicating whether or not the user has disabled some of those potential features.

I just tested to make sure, and it continued to report a "1" on my browser after I disabled Javascript.

answerman's Avatar
answerman | 3 years, 4 months ago Report

Also, I then promptly forgot that I turned off Javascript and started getting a bit frustrated at the "sudden wonkiness" of the Mahalo pages.


:facepalm:

Report Abuse

Post Reply Cancel

Learn something new with our FREE educational apps!

Private lessons in the comfort of your own home. Get back in shape or finally pick up a guitar with our great experts guiding you the whole way!
Learn Guitar
Learn Hip Hop
Learn Pilates