I'm trying to test if the .prop()
method exists on the current jQuery included (for compatibility reason) via:
if(typeof $.prop === 'function')
I would expect that the condition above is true
for jQuery >= 1.6
and false
for jQuery < 1.6
as I can understand from the docs
Anyway, testing this on jsfiddle, leads to:
typeof $.prop === 'function'
is:
true
whenjQuery >= 1.6
false
whenjQuery < 1.6 and jQuery > 1.3
true
whenjQuery <= 1.3
here is the very very simple script which provide the results above (just switch jQuery version to see what I've described).
When I try to use that .prop()
with jQuery i.e. 1.3 I get the .prop is not a function
error.
The same problem occours also testing outside jsfiddle.
Is it normal such a behavior?
How could I truly test if .prop()
is available?
Thanks