how can i extend $.browser
I want to write some jquery that will extend $.browser with开发者_如何学JAVA some of my own properties. So it I can currently access $.browser.msie, how could I extend it to include $.browser.isPngSupported etc?
You can just set $.browser.isPngSupported
to true
or false
.
However, you should be extending $.support
, not $.browser
.
var newData = { 'isPngSupported': true,
'more': 'x',
'evenMore': 'y' };
$.browser = $.extend( true, $.browser, newData );
精彩评论