This question already has answers here:
Redirect parent window from an iframe action
(14 answers)
Closed 9 years ago.
I have a html page and on GO button i have write redirecting code
window.location.replace(url);
I put this page in iframe and on click on GO button result page should open in the existing page replacing the url of the browser but it is opning in iframe only...
I tried
<base target="_parent" /> also but no luck
window.top.location.href is what you're looking for.
Your result page needs to break out of the iframe:
http://www.w3schools.com/js/tryit.asp?filename=tryjs_breakout
Related
This question already has answers here:
How do I modify the URL without reloading the page?
(20 answers)
Closed 8 years ago.
I am in a page with url
https://mysite.com/tst/v1/my-app/var/$%5Btest_new_var%5D.
On click i want to change the url to
https://mysite.com/tst/v1/my-app/" without reloading the page.
How can i do that?
please help,
Thanks.
In newer browsers that support history.pushState you can replace the url without reloading.
Lets say a user browses to http://example.com/ernie.html
window.history.pushState({ foo: "bar" }, "page 2", "bert.html");
Will change the address bar to http://example.com/bert.html, but won't cause the browser to load bert.html or even check that bert.html exists.
This question already has answers here:
Javascript : Change the function of the browser's back button
(5 answers)
Closed 8 years ago.
I have a page where the content is delivered mostly though javascript. Hitting the back button would basically exit the page to wherever the user came from instead of showing the previous content. Is there a way to take manual control over what the back/forwards buttons do on a web page?
This is a classic AJAX problem - each page is loaded asynchronously with no new GET from the browser, thus no history.
Look into History API of HTML5 to programatically push page state into the browser history. Other than that you are out of luck.
This question already has answers here:
Access elements of parent window from iframe
(4 answers)
Closed 9 years ago.
Let's say that I've got a page in an iframe.
So...
top page {
iframed page{
}
}
Now, I want to give the iframe page an id.
From within the code on the iframed page, can I check to see if the value of the id of the iframed page is equal to something?
if ($('#iframeid', window.parent.document))
doesn't seem to work.
If it's Chrome or Firefox, you should be able to do:
window.frameElement.id
inside the iframe to get the id of the iframe itself.
This question already has answers here:
How to communicate between iframe and the parent site?
(7 answers)
Closed 8 years ago.
I have a question about data transfer on iframes as can be seen in the picture below
http://img703.imageshack.us/img703/143/qcvf.jpg
My main page has 2 iframe.
How can I send a data to textbox iframe_b from main page when I working iframe_a?
Thanks.
You can try to set the iframe's src with a hash, and detect hashChange within the iframe. $(window) bind hashchange how to check part hash changed?
If you want to set data into iframe in script directly, I remember, not so sure, if the src of iframe is a different host, you cannot, for security reason.
This question already has answers here:
How can I access the contents of an iframe with JavaScript/jQuery?
(15 answers)
Closed 5 years ago.
I've got a website which has a iFrame in it. The iFrame is linked to an external page. I want to remove some elements in the external website (the website has HTML coding) using Javascript (other methods OK too) WITHOUT anyone clicking on any "remove" buttons or do anything, so it should AUTOMATICALLY remove that element when my webpage and the iframe loads, no one can see it.
For example, I want to remove a website's logo and some contents. I've tried lots of methods but they don't work in iFrame.
Unfortunately you cannot access elements in an Iframe if the Iframe is linked to an external site, there is no workaround using javascript.