component: |
unfiled → support
|
priority: |
undecided → low
|
resolution: |
→ duplicate
|
status: |
new → closed
|
In your original ticket, you mentioned that the output you were getting when alerting $.browser.msie and $.browser.opera was a value of 'undefined'.
If you test this (http://jsfiddle.net/ZupAr/) in Opera, you'll find that msie returns 'undefined' and if you test it in Firefox you'll find that both values return undefined.
This is expected behaviour. We *expect* IE to return a value of undefined against a UA test for Opera through $.browser. To use $.browser correctly, all you need to do is check against a particular value expected as follows:
if($.browser.msie){ //returns true if IE, undefined if not (ie. not true/false)
//do something
}else{
//not in IE, do something else
}
the same could be said for any other browser. Test against the value you know will return positive when used with a specific browser and then just fallback on the 'else' is the value isn't true.
I notice that this is an enhancement request. Because we've been returning a value of undefined for quite some time and the plans are to deprecate $.browser and move it into its own plugin in the future, I don't think it makes sense for this behaviour to be altered. We may however document further what is returned to avoid future confusion.
In your original ticket, you mentioned that the output you were getting when alerting $.browser.msie and $.browser.opera was a value of 'undefined'.
If you test this (http://jsfiddle.net/ZupAr/) in Opera, you'll find that msie returns 'undefined' and if you test it in Firefox you'll find that both values return undefined.
This is expected behaviour. We *expect* IE to return a value of undefined against a UA test for Opera through $.browser. To use $.browser correctly, all you need to do is check against a particular value expected as follows:
the same could be said for any other browser. Test against the value you know will return positive when used with a specific browser and then just fallback on the 'else' is the value isn't true.
I notice that this is an enhancement request. Because we've been returning a value of undefined for quite some time and the plans are to deprecate $.browser and move it into its own plugin in the future, I don't think it makes sense for this behaviour to be altered. We may however document further what is returned to avoid future confusion.