开发者

Retrieving data from MySQL with html/javaScript on one domain and the PHP file on the other

I need to retrieve data from a MySQL database, and have it work one way for all types of servers. For example it should work on a server that runs no server side language, it should also work on LAMP, and IIS.

I was thinking about using ajax and xmlhttprequest, but learned of the cross domai开发者_如何学运维n limitation. I also tried to just include the PHP in a tag, but it comes back with a syntax error in the HTML code created by the PHP file, even though it looks correct.

Does anyone know how to fix either of these issues, or have a different way to go about it?


If you use the cross-domain ajax, the result should be straight JavaScript code, and should not contain any HTML whatsoever. This page has a description of the technique for cross-domain ajax.

See Also: How to access different domain data using Java script

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜