JSON - Return html
I need a request to be sent to an external website wit开发者_开发技巧h the html back. I then need to extract the text within <td></td>
. I am completely new to JSON, and am unsure if it's possible to do this using ajax.
Please could someone point me in the right direction and/or give example code.
You can't directly make a request to an external site via JS and read HTML from it. It's forbidden by the same origin policy. Either the external site has to support you by offering something like JSONP or CORS (not supported by all browsers yet), or you'll have to proxy the request via your own server.
精彩评论