By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
434,741 Members | 1,979 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 434,741 IT Pros & Developers. It's quick & easy.

Pop up alert

P: 7
Hi, does anyone know how to make a alert pop up open for only certain browsers, using javascript...specifically IE 7 or older
Oct 15 '08 #1
Share this Question
Share on Google+
14 Replies


P: 55
I usually just do :

Expand|Select|Wrap|Line Numbers
  1. if(document.all){alert('your alert text here')}
but it depends on what browser specifically....if you just need it for ie in general, the above will work
Oct 16 '08 #2

acoder
Expert Mod 15k+
P: 16,027
IE is not the only browser which supports document.all.

OP: why do you need an alert for a specific browser? Perhaps if you explain your problem, we could suggest an alternative.
Oct 16 '08 #3

P: 7
I designed a site and went overboard with transparent div tags, at the time I wasn't aware of IE (pre 7) limitations

here's the link
http://www.friendsofinstapstudycenter.net/INSTAP-NEW/
Oct 16 '08 #4

acoder
Expert Mod 15k+
P: 16,027
Instead of an alert, add a filter for IE to allow it to display transparent PNG images.
Oct 16 '08 #5

P: 7
hmm gave the ie filter a shot. i noticed a slight size change with some images but wouldn't work for me.
Oct 16 '08 #6

acoder
Expert Mod 15k+
P: 16,027
Try using the IE7 library to bring IE5-6 up to date.
Oct 16 '08 #7

P: 7
awesome it worked! one problem though. it works only when I have actual images living in a file,

eg.http://www.friendsofinstapstudycenter.net/INSTAP-NEW/TEST.html

but what do I do if the images are being called from div tags in my css stylsheet?
Oct 16 '08 #8

acoder
Expert Mod 15k+
P: 16,027
Could you give an example?
Oct 16 '08 #9

P: 55
acoder....I'm just curious, I've only been developing js for about year, and I've tested my systems on ie 5-7 ff 2&3, and the newest safari....of those only the ie versions support document.all....what other browsers do?


ANSWER:::

after I posted this I went and looked around a bit like I should have done BEFORE I asked;)

Explorer 4+, Opera 6+, iCab, Ice, Omniweb 4.2-

ALL support document.all
Oct 16 '08 #10

P: 7
acoder, you have been a great help. I renamed all my images to implement the IE -7 filter. Works great! My only question is, is it common for links to lose functionality if the are in a div that embeds transparent images that have been corrected by the applied java script filter, or did I do something incorrectly?

regards
Oct 17 '08 #11

acoder
Expert Mod 15k+
P: 16,027
That shouldn't happen. Does this affect all browsers or only IE6?
Oct 20 '08 #12

P: 7
just 6.0, and 5.0 also
Oct 24 '08 #13

acoder
Expert Mod 15k+
P: 16,027
Is the page where you've made the changes the one you linked to earlier?
Oct 25 '08 #14

P: 7
didn't want to overwrite the old so i had to change to
http://www.friendsofinstapstudycente...EW2/index.html
on the above url, my 'new book' hovers/links at the bottom are disabled

and here:
http://www.friendsofinstapstudycente...log/index.html
my side navigation is disabled... confusing
Oct 27 '08 #15

Post your reply

Sign in to post your reply or Sign up for a free account.