Forum Moderators: open

Message Too Old, No Replies

javascript to prevent page from loading if clients are using IE

         

muhan

6:58 am on Jan 26, 2009 (gmt 0)

10+ Year Member



Hello!
I want my HTML and php pages not to be loaded if the clients are browsing the pages using Internet Explorer.
I'm trying some code using Javascript. but it ain't work.

janharders

7:38 am on Jan 26, 2009 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



I'd just redirect to some nagging "don't use internet explorer"-page if you really want to annoy your visitors. look for conditional comments and just embed your redirect code in a conditional comment that checks for internet explorer

piatkow

1:18 pm on Jan 26, 2009 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



This is off topic for the Link Development forum but I am sure a mode will move the thread to the HTML forum in due course.

The page has to download in order to execute the JS so your conditional action has to follow on from the download. You also have to allow for visitors to have JS switched off.
There are several possibilities for addressing this but as janharders posted the easiest is a redirect.
There are bound to be ways to handle PHP pages conditionally but my only PHP experience is "monkey see - monkey do" with pre-written scripts so I can't advise with that.

Despite my personal preference for Firefox I am puzzled as to why you should want to block the world's most widely used browser.