Use Jquery Selectors on $.AJAX loaded HTML?

前端 未结 9 885
没有蜡笔的小新
没有蜡笔的小新 2020-11-27 11:30

I have

$.ajax({
  url: identity,
  success: function(data) { ProcessIdentityServer(data) }
});

When \'data\' is returned, is there a way to

9条回答
  •  南笙
    南笙 (楼主)
    2020-11-27 12:23

    Presuming that data is a string of HTML, you can do this:

    $(data).find('a');
    

    That will return the links without adding the data to the DOM.

提交回复
热议问题