我能夠從server
{"html":"response header <!doctype html>MY Intrest is this HTML Block<html></html>"}
如何從Ajax響應取出頭
得到響應以這種方式我想刪除response header
什麼它看起來像這樣HTTP\/1.1 200 OK\r\nDate
,直到它找到<!doctype html>
這裏我的樣品數據:
{"html":"HTTP\/1.1 200 OK\r\nDate: Fri, 30 Dec 2016 07:33:08 GMT\r\nExpires: -1\r\nCache-Control: private, max-age=0\r\nContent-Type: text\/html; charset=ISO-8859-1\r\nP3P: CP=\"This is not a P3P policy! See https:\/\/www.google.com\/support\/accounts\/answer\/151657?hl=en for more info.\"\r\nServer: gws\r\nX-XSS-Protection: 1; mode=block\r\nX-Frame-Options: SAMEORIGIN\r\nSet-Cookie: NID=93=ntWba1QpElyHkWL02fhHB6zujRcM8Sb6dfSww39vgUSaNOg6ya2e6PCZ2BA1zYhP2w9qeCy8X416oWKhHKfBAa17kEgNiRoSU0kMbRfuyVtahTUYDpCqS7knxRPhYSyei3MpXIakXU9BepA; expires=Sat, 01-Jul-2017 07:33:08 GMT; path=\/; domain=.google.com; HttpOnly\r\nAccept-Ranges: none\r\nVary: Accept-Encoding\r\nTransfer-Encoding: chunked\r\n\r\n<!doctype html><!-- THIS WHAT I WANT --><\/html>"}
如何刪除此response header
?
我的預期輸出:<!doctype html><html>content goges here</html>
你想提取字符串「<!DOCTYPE HTML>這裏內容goges」 – codeMan
@codeMan,你讓我找到這就是正是我要找的 –
這是一個有效的問題爲什麼要投票?'任何原因 –