The design of my website is pretty ugly with versions of Internet Explorer smaller than 7. I'd like to display a javascript alert for the users whose browser is concerned.
Something like : "The design of the website is not optimized for your browser. Please upgrade ... "
The thing is that javascript code inside conditional ments doesn't work so how can I do this ?
The design of my website is pretty ugly with versions of Internet Explorer smaller than 7. I'd like to display a javascript alert for the users whose browser is concerned.
Something like : "The design of the website is not optimized for your browser. Please upgrade ... "
The thing is that javascript code inside conditional ments doesn't work so how can I do this ?
Share Improve this question asked Sep 12, 2011 at 10:05 BrunoBruno 9,10713 gold badges40 silver badges55 bronze badges 1- Have a look at: browserupgrade.info/tools – Felix Kling Commented Sep 12, 2011 at 10:07
4 Answers
Reset to default 3Works fine for me:
<!--[if IE 6]>
<script>alert("IE 6");</script>
<![endif]-->
http://jsfiddle/W9gPQ/1/
I wouldn't do this if I were you, though. An alert()
is terribly obtrusive. Why not just show a div
.
The alert will work fine, in the sites where javascriptting is allowed. The following code part will be used to show an alert
<script>
alert("Your Message");
</script>
Refer to alert for more details.
Here´s some great info about Conditional ments; http://www.quirksmode/css/cond.html
...and perhaps this IE 6 block script can inspire you; http://css-tricks./955-ie-6-blocker-script/
Good luck! :)
Just made a jQuery plugin to solve these kind of problems. Check it out on: http://nmsdvid./iealert/