在jQuery中不可用的DOM属性/方法? [英] DOM properties/methods that aren't available in jQuery?

查看:117
本文介绍了在jQuery中不可用的DOM属性/方法?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

关于我的关于jQuery.get()的问题,我想知道是否有在jQuery中不可用的DOM属性和方法的列表,只有当您使用原始DOM对象(即$(#someID))get()时,才可以访问。scrollHeight;)

Following up on my question about jQuery.get() I was wondering if there is a list of DOM properties and methods that aren't available in jQuery that can only be accessible if you were working with the raw DOM object (i.e. $("#someID").get().scrollHeight; )

推荐答案

我没有遇到过列表,但是如果存在,可能会很长。除了浏览器专有(专有)属性之外,还有一些其他不太有用的属性和方法目前尚未被jQuery抽象出来。但是,我并不认为这是一个问题,甚至是一个有效的讨论点,因为jQuery是JavaScript;如果您需要访问超出jQuery提供的内容,那么您可以使用 get() 或访问您的jQuery集合之一中的指定元素像一个数组:

I haven't encountered a list but if one existed it would probably be quite lengthy. In addition to browser-specific (proprietary) properties there's a bunch of other less useful properties and methods not currently abstracted by jQuery. But then, I don't really see this as a problem, or even a valid point of discussion because jQuery IS JavaScript; if you need access to something beyond what jQuery provides then you can use get() or access a specified element within one of your "jQuery collections" like an array:

jQuery(elem)[0].someDOMProperty;

加jQuery绝对不支持DOM内的非元素节点。如果由于某种原因,您需要直接访问评论节点,文本节点等,那么您需要使用rawDOM。

Plus jQuery provides absolutely no support for non-element nodes within the DOM. If, for whatever reason, you need direct access to comment nodes, text nodes etc. then you'll need to use the "raw" DOM.

这篇关于在jQuery中不可用的DOM属性/方法?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆