Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Alert Box for Javascript disabled browser

Posted on 2001-08-21
7
Medium Priority
?
505 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
VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

 
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

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

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

In Part 1 (http://www.experts-exchange.com/Programming/Languages/Scripting/JavaScript/A_7849-Hex-Maze.html) we covered the hexagonal maze basics -- how the cells are represented in a JavaScript array and how the maze is displayed.  In this part, we'…
The task A number given should be formatted for easy reading by separating digits into triads. Format must be made inline via JavaScript, i.e., frameworks / functions are not welcome. So let’s take a number like this “12345678.91¿ and format i…
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…

618 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