English 中文(简体)
可在j Query(表达、[内容])中使用什么?
原标题:What can be used as [context] in jQuery( expression, [context] )?

以下代码没有返回任何内容:

$( .foo , $( <div class="foo">foo</div><div class="bar">bar</div> ).get(0)).html()

是否有任何办法具体指明Xml/html作为context paraile of jQuery功能? I m试图选择从jax请求中检索的html文件的一个部分;ajax呼吁(例如,使用<代码>$.get(>,例如)提供这一数据:html>。

最佳回答

您的例子就是,你的背景是两个令人信服的因素。 采用一个包裹的内容将使你能够选择其中的内容。 通知这里的差异:

$( .bar , $( <div class="foo"><div class="bar">bar</div></div> )).html(); // outputs "bar"
问题回答

暂无回答




相关问题
ajax login using httpRequest?

I am trying to develop my login script to give feedback to the user if the login is valid or not. Basically if it isn t correct a div box will show saying its wrong, if its correct it will show its ...

Virtual Tour using sketch up, ajax, flash technologies

I want to know if there are existing technology that make your 3d models in sketch into virtual tours, using either Ajax or Flash for web presentation. If there s none, which will be a good approach ...

How can i update div continuously

I have asp.net application where i have a div which showing the value from other site. The value of that site is changing continuously. I want that my div will automatically update in some interval ...