jQuery $() function [closed]
I am new to javascript and jquery so I am wondering what does
$('#someid a')
referring to?
and when does the function $.get get called? (since I feel the code after $.get is called before $.get
Thanks in advance.
$('#someid a')
Selects all a
tags contained within an element with the id someid
I don't see any calls to $.get
, so I don't understand that part of the question.
It creates (selects (it's a selector)) a new jQuery object which holds a
tag in #someid
$.get
is called to call a page with ajax
$("#someid a")
will select all <a>
tags that are inside of the first element that has an id of #someid
.
$.get()
makes an asynchronous http request to the given url. once the request returns, the callback is ran.
i suggest going through the jquery getting started tutorials
http://docs.jquery.com/Main_Page
Selects zero or more 'a' tags contained by a tag with id "someid". $.get is called when the execution gets to the line containing $.get. See the documentation for more information about $.get here: http://api.jquery.com/jQuery.get/
精彩评论