Strike Force Heroes 2
The explosive sequel to the hit game Strike Force Heroes!
3.95 / 5.00 9,176 ViewsObsolescence
Defeat the enormous mechanical beasts--and become one of them.
4.02 / 5.00 43,683 ViewsWhat is the javascript code to detect whether someone is using, Internet Explorer, Firefox, Safari, Opera or Chrome? These are the only ones I'm interested in
You can just use this or this .
To detect the browser you just need to perform string operations on the user agent (accessed via the navigator.userAgent property). However, there is no point in you writing your own; don't re-invent the wheel.
At 4/10/12 10:02 AM, Diki wrote: You can just use this or this .
To detect the browser you just need to perform string operations on the user agent (accessed via the navigator.userAgent property). However, there is no point in you writing your own; don't re-invent the wheel.
Just as a reference, there's a nice PEAR repo: http://pear.php.net/package/Net_UserAgent_Detect/
In certain use cases feature detection is far more accurate potent and safer solution. I would personally never look at user agent strings as they offer no guarantee.
if(window.history.pushState){
}
Modernizr is a popular library which helps you safely detech and make use of browser features.
At 4/11/12 09:38 AM, McPaper wrote: In certain use cases feature detection is far more accurate potent and safer solution. I would personally never look at user agent strings as they offer no guarantee.
It's JavaScript; there is no guarantee it will work no matter how you do it.
At 4/11/12 10:10 AM, Diki wrote:At 4/11/12 09:38 AM, McPaper wrote: In certain use cases feature detection is far more accurate potent and safer solution. I would personally never look at user agent strings as they offer no guarantee.It's JavaScript; there is no guarantee it will work no matter how you do it.
This is probably the worse response I've heard.
At 4/12/12 09:13 PM, skstid2012 wrote:At 4/11/12 10:10 AM, Diki wrote: It's JavaScript; there is no guarantee it will work no matter how you do it.This is probably the worse response I've heard.
Why? Because it's completely correct?
At 4/12/12 09:38 PM, WoogieNoogie wrote:
Why? Because it's completely correct?
It can be correct and most of the time, it is. However, It's not always correct. Therefore, I think we shouldn't use absolution for cases that aren't entirely absolute.
At 4/12/12 09:51 PM, skstid2012 wrote: It can be correct and most of the time, it is. However, It's not always correct. Therefore, I think we shouldn't use absolution for cases that aren't entirely absolute.
JavaScript is a client-side scripting language that can be enabled/disabled on the client's whim, including only disabling specific scripts opposed to all of JavaScript.
If JavaScript is not enabled it will not work. Hence there is no guarantee any script you ever write will work.
And that's not even getting into the fact that every browser compiles and executes JavaScript differently.
Internet Explorer 6-8, for example, will halt execution of any script if it ever encounters console.log. As well, every version of Internet Explorer will throw parse errors if it encounters the const keyword, whereas FireFox or Chrome will not.
At 4/13/12 09:20 AM, Diki wrote: Everything you just said.
Good response. That's what I'm talking about right there.
At 4/13/12 09:20 AM, Diki wrote: And that's not even getting into the fact that every browser compiles and executes JavaScript differently
That point of feature detection is to not encounter these issues.