开发者

Asynchronously downloading files via php script

On my company's network, there's a page that generates a topographical range gradient KML based on points passed in through the URL. The problem is that the page takes an average开发者_运维百科 of 30 seconds to complete a request, and I need about 70 requests daily. What I plan to do is have my office's website use a local copy and only re-download when the coordinates change. But I'm having a hard time getting this to work asynchronously. Right now I'm using $.get() to try and load them asynchronously. However, I'm getting no response from the website using get. It returns a status 200 OK, but the line is highlighted in red in Firebug. When I swap out that url for a kml hosted through our site, it returns 200 OK in black, and has the contents of the KML as the response. Why would the remote tool not be downloading correctly?


Same Origin Policy prevents you from making requests to another domain. You either need to look into CORS [if the browser and other site support it], JSONP [if other site support it], or a local proxy.


You are not allowed to send cross-domain AJAX requests. That could be a problem if you try to download a file with $.get from another domain.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜