Detect if javascript enabled in a perl script

Hi Experts,

Okay, huge newbie question here: is there a way to detect in a cgi perl script whether or not the user has javascript enabled?

Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

I don't know of a way directly, but there are a few things you could do to find out:

1) If there is a form that gets submitted, have a hidden field.  Then have a javascript function that puts something in that field.  When you process that form, if the field is blank (or default), no javascript.  If it has the updated value, then javascript is enabled.  If you put this on a login page, you know the user will get to it before any other pages.

2) Have a javascript redirect the web browser to the page with an extra parameter.  Then have your script check for that parameter.
For example, if you have, have a javascript function redirect to  Then check for the "javascript=yes" part.  If it's there, then javascript is enabled.

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
spike3382Author Commented:
Hey, number 1 is a great idea!  It's for a cart, and I know that something has to be added before the user hits the cart, and I can store it in their session variables... which if they aren't there means there's also nothing in the cart.  Perfect!

Thanks a lot!
glad it'll work.  thanks for the grade  :)
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today

From novice to tech pro — start learning today.