OZONE Asylum
Forums
DHTML/Javascript
browsercheck, check to see if javascript is enabled, flash detect, and screen resolution
This page's ID:
28912
Search
QuickChanges
Forums
FAQ
Archives
Register
Edit Post
Who can edit a post?
The poster and administrators may edit a post. The poster can only edit it for a short while after the initial post.
Your User Name:
Your Password:
Login Options:
Remember Me On This Computer
Your Text:
Insert Slimies »
Insert UBB Code »
Close
Last Tag
|
All Tags
UBB Help
[i]Ring! ring! It's 1996 calling. Give me my homepages back or else.[/i] What kind of application/site do you write to have such requirements ? [quote]Also if the browser is mozzilla do nothing, but if anyother alert(message).[/quote]What does mozilla do that other browsers such as IE6/7, Safari, Opera, Omniweb, Konqueror, ... don't ? You should definitely do features detection instead of browser detection. Also the kind of function you want is the very reason why it's so easy today to spoof the UA string. [quote]If javascript is enabled do nothing if it is not, alert(message);[/quote]Easy:[code]<noscript><script language='javascript'> document.write( '<scr'+'ipt>alert(message)</scr'+'ipt>') </script></noscript>[/code]:) I hope you can see the irony here. Actually I've seen such absurdities in the the wild a few times. [quote]last if screen is small than 1024x768 than alert(message).[/quote]Since when the screen resolution meant anything WRT to the resolution of the browser windows ? FYI my laptop is in 1024x768, my browser is maximised and my windows/tabs are maximixed, the windows/tabs are 822x652. If a page needs a horizontal scrollbar I make it Fit-To-Width or Zoom it out to 80 or 90% [quote]I have tried and dosent work right now I have 5 separte funtions and its okay but if this could be in one function that would be cool. thanks for whomever can help.[/quote]Make your 5 function [i]true[/i] or [i]false[/i] depending if the requirement tested is met or not then combine the calls in one function:[code]function allTestInOne() { var goOn = false; goOn = testRequirement1() if( goOn ) goOn = testRequirement2() if( goOn ) goOn = testRequirement3() if( goOn ) goOn = testRequirement4() if( goOn ) goOn = testRequirement5() if( goOn ) self.location.replace( 'home.asp' ) else self.location.replace( 'http://www.w3.org/WAI/' ) }[/code]Hope you'll reconsider at least some of your requirements. [url=http://www.p01.org/][sigrotate][img]http://poi.ribbon.free.fr/files/p01_ozoneasylum_sig_love.gif[/img]|[img]http://poi.ribbon.free.fr/files/p01_ozoneasylum_sig_love_small.gif[/img]|[img]http://poi.ribbon.free.fr/files/p01_ozoneasylum_sig_charly.gif[/img]|[img]http://poi.ribbon.free.fr/files/p01_ozoneasylum_sig_dk.gif[/img]|[img]http://poi.ribbon.free.fr/files/p01_ozoneasylum_sig_reason.gif[/img]|[img]http://poi.ribbon.free.fr/files/p01_ozoneasylum_sig_galaxy.gif[/img][/sigrotate][/url]
Loading...
Options:
Enable Slimies
Enable Linkwords
« Backwards
—
Onwards »