开发者

jQuery $() function [closed]

It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot开发者_开发问答 be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center. Closed 11 years ago.

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/

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜