开发者

javascript regular expression select html element with class="product" from string

lets say i use jquery.get to retrive a website to string and how am i gonna select the whole table with clas开发者_运维问答s=product from it? $() seem cant work on string ....


You can use .load() for this, like this:

$("#elementToLoadIn").load("myPage.htm .product");

The format is "url selector" (note the space there).

The $.get alternative is:

$.get("myPage.htm", function(data) {
   $("#elementToLoadIn").html($(".product", data));
});
0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜