Jump to content

Alert for IE not working


reportingsjr

Recommended Posts

Well, my site works best in Firefox but not in IE so I wanted to have an alert to say "You are using Internet Explorer! For the best optimization(preformance) of our website please use Firefox or Opera, both of which you can get free!"But, I think the popup blocker on IE blocked it. Any ideas on how to get past this, or do I have my coding wrong on this (sorry, im not too good at javascript. Im finally doing tutorials on it today!)

<!--[if IE]><script LANGUAGE="Javascript">alert("You are using Internet Explorer! <br />For the best optimization(preformance) of our website please use <a href="http://mozilla.org">Firefox</a> or Opera, both of which you can get free!");</SCRIPT>Please download Firefox by clicking on the following banner:<br /><a href="http://www.spreadfirefox.com/?q=affiliates&id=0&t=76"><img border="0" alt="Get Firefox!" title="Get Firefox!" src="http://sfx-images.mozilla.org/affiliates/Buttons/120x60/take.gif"/></a><![endif]-->

Now the code part works. Its just the popup which is basically the main part. Thanks!

Link to comment
Share on other sites

or do I have my coding wrong on this (sorry, im not too good at javascript. Im finally doing tutorials on it today!)
Yes your code is the problem here :) You cannot use double/single quotes within each other without escaping them or used in the correct nesting order :) if you know what i meanalert("My name is "Scott"") this is incorrect - double within doublealert("My name is \"Scott\"") this is correct - backslash means literally print the double quotealert("My name is 'Scott'")this is correct - single used within doublealert('My name is "Scott"')this is correct - double used within singlealert('You are using Internet Explorer! <br />For the best optimization(preformance) of our website please use <a href="http://mozilla.org">Firefox</a> or Opera, both of which you can get free!');I tend to start my alert with single quotes then use double inside themIt can get trickier if the quotes go a step further, then you need to use the backslashalert('My name is "Scott\'y"');
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...