Ajax: Load XML from different domain?

后端 未结 3 1502
天命终不由人
天命终不由人 2020-12-21 15:10

I have signed up(paid) for Google site search. They have me a url of a sort of web service where I can send a query to it, it searches my site, and it returns XML of the sea

3条回答
  •  心在旅途
    2020-12-21 15:30

    You can't load external files with AJAX. However, you can set up a file on your own server that makes the content available on your server. For instance in PHP, you could write a file googlexml.php:

    
    

    And then you could access that with AJAX. I'm not sure if Google's terms of use will let you do that, but if they do, then this is an option.

提交回复
热议问题