Relegence
asked on
Redirect within an Iframe
Hello,
I have an iframe which is located inside a webpage. When i click a button within the iframe which does a redirect to a new url, the new url is displayed on the whole page and not only within the frameset.
I am using: this.document.location.hre f = url;
How can i make sure the new url would open within the framset only?
Thanks,
Dana
I have an iframe which is located inside a webpage. When i click a button within the iframe which does a redirect to a new url, the new url is displayed on the whole page and not only within the frameset.
I am using: this.document.location.hre
How can i make sure the new url would open within the framset only?
Thanks,
Dana
the new url will open on the same window by default not unless your new url breaks frame or has a target pointed to "_top".
"your new url breaks frame" --> "your new url has a script which breaks frame"
btw, do you own the new url page?
btw, do you own the new url page?
ASKER
I am sorry, I just realized that the problem is slightly different:
The Iframe is located at the bottom of the parent page. When redirecting, the focus of the parent page is set to the iframe so that it looks at the top. But, if you scroll up you can see the rest of the parent page.
How can i redirect and live the focus at the same position?
Thank you
The Iframe is located at the bottom of the parent page. When redirecting, the focus of the parent page is set to the iframe so that it looks at the top. But, if you scroll up you can see the rest of the parent page.
How can i redirect and live the focus at the same position?
Thank you
or you may try this
document.getElementById(yo urIFrameID ).src = url;
document.getElementById(yo
ASKER
I don't own the parent page.
The parent page which holds the Iframe is managed by someone else whom i gave the url to the iframe.
The iframe contains buttons that cause redirect to the same Iframe.
The question is why after redirect the focus of the parent page is moved to the iframe?
The parent page which holds the Iframe is managed by someone else whom i gave the url to the iframe.
The iframe contains buttons that cause redirect to the same Iframe.
The question is why after redirect the focus of the parent page is moved to the iframe?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Just what i needed. Thanks!!!
window.location.href = url ;