开发者

Javascript: client-side webservice with <script> tag

I'm trying to implement sort of client-side webservice client.

To get over the same server policy, i'm thinking of including the external page whose content I need to read via the <script> tag that can get cross-domain content. I have no control over the webservice being consumed, so i can't actually return javascript code (it's a simple html page returning "OK" or "KO" in the body).

It seems like I can't use src="text/html", only "text/javascript" 开发者_开发百科is accepted and this yelds an obvious error as an html page can't be evaluated as javascript code.

Apart from that, how can I then read the loaded script's content? With Google Chrome's javascript console I can see that the page is loaded withing the script, only I don't know how to access it.

PS: I'm using jQuery, if this helps.


You can't. If this worked, it would expose private (e.g. protected by cookies) user data to third-party sites.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜