yantianqi
V2EX  ›  jQuery

jq ajax 返回的数据怎么获取其中一部分?

  •  
  •   yantianqi · Dec 5, 2016 · 4336 views
    This topic created in 3528 days ago, the information mentioned may be changed or developed.

    例如 data 返回数据为一整个网页 如何只获取 body 内容?

    <html>
      <head>
      <title>title</title>
      </head>
      <body>
        如何只获取 body 中的内容
      </body>
    </html>
    
    1 replies    2016-12-05 11:15:30 +08:00
    hiro0729
        1
    hiro0729  
       Dec 5, 2016
    $(data).find('body')
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   956 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 26ms · UTC 20:07 · PVG 04:07 · LAX 13:07 · JFK 16:07
    ♥ Do have faith in what you're doing.