开发者

Getting window.location in embedded Flash

I embed a .swf file in HTML and then embed this HTML itself in another HTML.

In the .swf file I call

ExternalInterface.call(" function(){ return window.location.toString();}";

The problem is sometimes I seem to get window location of the embedded HTML and sometimes I get address of the main HTML (see picture).

Getting window.location in embedded Flash

All I am after is reliability. I want to get the same address everytime. I haven't eve开发者_JAVA技巧n been able to understand when it get which location. I wonder if it is some sort of browser related mystery!

Thanks for any help

Cheers!

Ali


Using window.top.location.href should always give you the address the user sees in their location bar. Be wary of using .toString() on DOM objects in older versions of Internet Explorer.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜