开发者

how can i extend $.browser

开发者 https://www.devze.com 2023-03-11 07:47 出处:网络
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.isPngSup

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 );
0

精彩评论

暂无评论...
验证码 换一张
取 消