0

I have an iframe where a user has to perform a task and when the task is completed it will show another iframe where the user will perform a task and after that is completed a button will show

So I need to know how to - Check the current url of an iframe then - When the users url = example.com hide the iframe and show another then - When the user completes the task stated above a button will show

4

1 回答 1

0

只要您在 iframe 中引用的所有 url 都在同一个域中,您就可以这样做:

document.getElementById("id_of_iframe").contentWindow.location.href

但是,如果它们引用不同的域,您将遇到安全/跨域问题。

于 2013-04-22T01:58:00.230 回答