开发者

Cross Domain with frames

开发者 https://www.devze.com 2023-03-07 14:36 出处:网络
I have one html page with url : http://server1开发者_JAVA百科/phone_app which loads a frames from the url:

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

精彩评论

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