温馨提示×

温馨提示×

您好,登录后才能下订单哦!

密码登录×
登录注册×
其他方式登录
点击 登录注册 即表示同意《亿速云用户服务条款》

jQuery:查看API

发布时间:2020-06-02 07:38:23 来源:网络 阅读:944 作者:ztfriend 栏目:web开发

jQuery的api官方网址是:http://api.jquery.com,这个应当是最权威的(我推荐看这个)

如果网速,或者英语水平不够给力,可以搜索中文网页,

例如我搜到这个页面:http://www.css88.com/jqueryapi 大概就是翻译了jquery官方文档

文档毕竟是文档,实际应用时还是要眼见为实。

今天拿本机的开发环境(ie/firefox/safari/chrome)做了个实测(jQuery1.9.0),记录如下:

1)jQuery对象的方法在各浏览器中是一致的

    [Object] window.jQuery
        |--[boolean] isReady
        |--[function] _data
        |--[function] _queueHooks
        |--[function] _removeData
        |--[function] acceptData
        |--[function] access
        |--[function] ajax
        |--[function] ajaxPrefilter
        |--[function] ajaxSetup
        |--[function] ajaxTransport
        |--[function] Animation
        |--[function] attr
        |--[function] buildFragment
        |--[function] Callbacks
        |--[function] camelCase
        |--[function] cleanData
        |--[function] clone
        |--[function] contains
        |--[function] css
        |--[function] data
        |--[function] Deferred
        |--[function] dequeue
        |--[function] dir
        |--[function] each
        |--[function] error
        |--[function] Event
        |--[function] extend
        |--[function] filter
        |--[function] find
        |--[function] fx
        |--[function] get
        |--[function] getJSON
        |--[function] getScript
        |--[function] globalEval
        |--[function] grep
        |--[function] hasData
        |--[function] holdReady
        |--[function] inArray
        |--[function] isArray
        |--[function] isEmptyObject
        |--[function] isFunction
        |--[function] isNumeric
        |--[function] isPlainObject
        |--[function] isWindow
        |--[function] isXMLDoc
        |--[function] makeArray
        |--[function] map
        |--[function] merge
        |--[function] noConflict
        |--[function] nodeName
        |--[function] noop
        |--[function] now
        |--[function] param
        |--[function] parseHTML
        |--[function] parseJSON
        |--[function] parseXML
        |--[function] post
        |--[function] prop
        |--[function] proxy
        |--[function] queue
        |--[function] ready
        |--[function] removeAttr
        |--[function] removeData
        |--[function] removeEvent
        |--[function] sibling
        |--[function] speed
        |--[function] style
        |--[function] swap
        |--[function] text
        |--[function] trim
        |--[function] Tween
        |--[function] type
        |--[function] unique
        |--[function] when
        |--[number] active
        |--[number] guid
        |--[number] readyWait
        |--[object] ajaxSettings
        |--[object] attrHooks
        |--[object] cache
        |--[object] cssHooks
        |--[object] cssNumber
        |--[object] cssProps
        |--[object] easing
        |--[object] etag
        |--[object] event
        |--[object] expr
        |--[object] fn
        |--[object] lastModified
        |--[object] noData
        |--[object] offset
        |--[object] propFix
        |--[object] propHooks
        |--[object] support
        |--[object] timers
        |--[object] valHooks
        |--[string] expando

2)选择器返回的对象不是jQuery,而是jQuery.fn(仍是略有差异参见下一条)

    [Object] window.jQuery('body')
        |--[function] add
        |--[function] addBack
        |--[function] addClass
        |--[function] after
        |--[function] ajaxComplete
        |--[function] ajaxError
        |--[function] ajaxSend
        |--[function] ajaxStart
        |--[function] ajaxStop
        |--[function] ajaxSuccess
        |--[function] andSelf
        |--[function] animate
        |--[function] append
        |--[function] appendTo
        |--[function] attr
        |--[function] before
        |--[function] bind
        |--[function] blur
        |--[function] change
        |--[function] children
        |--[function] clearQueue
        |--[function] click
        |--[function] clone
        |--[function] closest
        |--[function] constructor
        |--[function] contents
        |--[function] contextmenu
        |--[function] css
        |--[function] data
        |--[function] dblclick
        |--[function] delay
        |--[function] delegate
        |--[function] dequeue
        |--[function] detach
        |--[function] domManip
        |--[function] each
        |--[function] empty
        |--[function] end
        |--[function] eq
        |--[function] error
        |--[function] extend
        |--[function] fadeIn
        |--[function] fadeOut
        |--[function] fadeTo
        |--[function] fadeToggle
        |--[function] filter
        |--[function] find
        |--[function] finish
        |--[function] first
        |--[function] focus
        |--[function] focusin
        |--[function] focusout
        |--[function] get
        |--[function] has
        |--[function] hasClass
        |--[function] height
        |--[function] hide
        |--[function] hover
        |--[function] html
        |--[function] index
        |--[function] init
        |--[function] innerHeight
        |--[function] innerWidth
        |--[function] insertAfter
        |--[function] insertBefore
        |--[function] is
        |--[function] keydown
        |--[function] keypress
        |--[function] keyup
        |--[function] last
        |--[function] load
        |--[function] map
        |--[function] mousedown
        |--[function] mouseenter
        |--[function] mouseleave
        |--[function] mousemove
        |--[function] mouseout
        |--[function] mouseover
        |--[function] mouseup
        |--[function] next
        |--[function] nextAll
        |--[function] nextUntil
        |--[function] not
        |--[function] off
        |--[function] offset
        |--[function] offsetParent
        |--[function] on
        |--[function] one
        |--[function] outerHeight
        |--[function] outerWidth
        |--[function] parent
        |--[function] parents
        |--[function] parentsUntil
        |--[function] position
        |--[function] prepend
        |--[function] prependTo
        |--[function] prev
        |--[function] prevAll
        |--[function] prevUntil
        |--[function] promise
        |--[function] prop
        |--[function] push
        |--[function] pushStack
        |--[function] queue
        |--[function] ready
        |--[function] remove
        |--[function] removeAttr
        |--[function] removeClass
        |--[function] removeData
        |--[function] removeProp
        |--[function] replaceAll
        |--[function] replaceWith
        |--[function] resize
        |--[function] scroll
        |--[function] scrollLeft
        |--[function] scrollTop
        |--[function] select
        |--[function] serialize
        |--[function] serializeArray
        |--[function] show
        |--[function] siblings
        |--[function] size
        |--[function] slice
        |--[function] slideDown
        |--[function] slideToggle
        |--[function] slideUp
        |--[function] sort
        |--[function] splice
        |--[function] stop
        |--[function] submit
        |--[function] text
        |--[function] toArray
        |--[function] toggle
        |--[function] toggleClass
        |--[function] trigger
        |--[function] triggerHandler
        |--[function] unbind
        |--[function] undelegate
        |--[function] unload
        |--[function] unwrap
        |--[function] val
        |--[function] width
        |--[function] wrap
        |--[function] wrapAll
        |--[function] wrapInner
        |--[number] length
        |--[object] 0
        |--[object] context
        |--[object] prevObject
        |--[string] jquery
        |--[string] selector
3)选择器执行了jQuery.fn,执行过程中添加了下列对象元素

        |--[object] 0
        |--[object] context
        |--[object] prevObject

其中context指向的是DOM对象,可用于通过jQuery.fn使用DOM原生方法。

想进一步研究对象内容,可访问http://idata.blog.51cto.com/4581576/1103835下载我的javascipt工具包,到本文完成之时(2013/1/21),版本为V1.0.3。

 

向AI问一下细节

免责声明:本站发布的内容(图片、视频和文字)以原创、转载和分享为主,文章观点不代表本网站立场,如果涉及侵权请联系站长邮箱:is@yisu.com进行举报,并提供相关证据,一经查实,将立刻删除涉嫌侵权内容。

AI