?
Solved

Alert Box for Javascript disabled browser

Posted on 2001-08-21
7
Medium Priority
?
504 Views
Last Modified: 2012-05-04
I would like to have an alert box which will pop up if the user has disabled Javscript on their machine, or if they are not using a Javascript enabled browser.  Basically a client-side sniff to detect whether their browser can do Javscript.  If not, the alert box pops up with a message.
0
Comment
Question by:SteveH012698
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 2
  • 2
7 Comments
 
LVL 19

Expert Comment

by:webwoman
ID: 6411099
I don't think so.. the alert box IS javascript. So if they don't have it enabled, it's not going to work.

Use a <noscript>tag

Like this

<noscript>Turn on javascript!</noscript>

That will work...
0
 

Author Comment

by:SteveH012698
ID: 6411166
That's what I thought... The <noscript> way could also be done with a redirected .asp page right off the server. Is there a way to put a detection script in the page that would launch a sized popup window if they have Javascript disabled? <body onLoad tag?> Something that would run when the page is loaded and launch a window, with a message, if they can't do Javascript.
0
 
LVL 53

Accepted Solution

by:
COBOLdinosaur earned 400 total points
ID: 6411222
Maybe something like this:

<html>
<head>
<style>
   .alertcls {width:200;height:150;background:navajowhite;border-width:2;
              border-color:slateblue;position:absolute;left:150;top:150;
              z-index:20;}
</style>
</head>
<body>
<noscript>
<div class="alertcls">
   Sorry you cannot run this page correctly with scripting turned off
</div>
</noscript>
the normal stuff of the page goes here
</body>
</html>

Cd&
0
Get 15 Days FREE Full-Featured Trial

Benefit from a mission critical IT monitoring with Monitis Premium or get it FREE for your entry level monitoring needs.
-Over 200,000 users
-More than 300,000 websites monitored
-Used in 197 countries
-Recommended by 98% of users

 
LVL 19

Expert Comment

by:webwoman
ID: 6411319
But... if I remember correctly, NN4+ turns off CSS when you turn off javascript... ;-)
0
 

Author Comment

by:SteveH012698
ID: 6411321
COBOL, in IE4 at least, that doesn't launch a popup window.  It prints the "Sorry you cannot run this page correctly with scripting turned off", message into a box on the page.  If you want to turn your scripting off & check it, go to:
http://www.houston-business.com/nojsalert.htm
0
 
LVL 53

Expert Comment

by:COBOLdinosaur
ID: 6411397
It's not supposed to put up a popup just a layer on top of anyother content.

You cannot launch a popup or do much of anything else without Javascript.  The styling is just out a little.  If there is no CSS support it still just displays the text.

Cd&
0
 
LVL 53

Expert Comment

by:COBOLdinosaur
ID: 6418083
Glad we could help.  Thanks for he A. :^)

Cd&
0

Featured Post

Get 15 Days FREE Full-Featured Trial

Benefit from a mission critical IT monitoring with Monitis Premium or get it FREE for your entry level monitoring needs.
-Over 200,000 users
-More than 300,000 websites monitored
-Used in 197 countries
-Recommended by 98% of users

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article discusses how to create an extensible mechanism for linked drop downs.
Boost your ability to deliver ambitious and competitive web apps by choosing the right JavaScript framework to best suit your project’s needs.
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)
The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…
Suggested Courses

771 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question