关于使用contextJquery 选择器的一个快速问题:
我正在尝试从具有id="time". HTML 片段可以按context如下方式使用:
// An AJAX request here returns a HTML snippet "response":
var myTime = $("#time", response).text();
我这样做的原因是我希望time保留 html 中的变量response,但不希望首先将所有 html 加载到 DOM 中的开销。(这是大量的html)。