Parsing returned HTML from jQuery AJAX request

后端 未结 7 1366
你的背包
你的背包 2020-12-01 14:01

What I\'m trying to do seems simple: get an HTML page through $.ajax() and pull out a value from it.

$(function () {
    $.ajax({
             


        
7条回答
  •  余生分开走
    2020-12-01 14:41

    I had the same problem and i fixed encapsulating requested html code into just one container element.

    Bad Example:

    Linkname
    

    Hello world

    Jquery couldnt convert this to element, because it wishes to convert a single element tree. But those are not having a container. Following example should work:

    Right Example:

    Linkname

    Hello world

提交回复
热议问题