开发者

Cross Domain with frames

I have one html page with url :

http://server1开发者_JAVA百科/phone_app

which loads a frames from the url:

http://server2/directory_app

in the contained frame (directory_app), I need the displayed URL in the browser which is actually (http://server1/phone_app). Unfortunately, i have no access to the container page, and because of the "same origin policy", i can't access the window.top.location.href.

Is there any way to do this?

Browser : IE7


No. You cannot read data from other domains (except via things like JSON-P which are not applicable in this situation).

You could pass in details into the frame via the query string:

src="http://server2/directory_app?a=b;x=y"
0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜