开发者

object.jquery attribute

开发者 https://www.devze.com 2022-12-26 16:47 出处:网络
what does this code performs? if(object.jquery){ .... } I don\'t know what jQue开发者_Python百科ry attribute does. I think it checks if \'object\' is a valid jQuery object, but I\'m not really sure

what does this code performs?

if(object.jquery){
  ....
}

I don't know what jQue开发者_Python百科ry attribute does. I think it checks if 'object' is a valid jQuery object, but I'm not really sure.

Thanks in advance.

Esteve


It's checking if object has a property called jquery, so yes it's checking if object is specifically a jquery object :)

It's not checking if it's been loaded (try it on this very page), that would be if(window.jQuery), but jquery objects have a property called jquery which is the version, for example:

$().jquery //on this page, as of now (when answered): "1.3.2"
0

精彩评论

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

关注公众号