The below is a fully working example. On what basis are pardoning decisions made by presidents or governors when exercising their pardoning power? ', referring to the nuclear power plant in Ignalina, mean? Thanks for contributing an answer to Stack Overflow! We use cookies to personalise content and ads, to provide social media features and to analyse our traffic. Whats the best way to reload / refresh an iframe? For this we will be making a custom JavaScript function that can be called via the onClick event on a button. Site design / logo 2023 Stack Exchange Inc; user contributions licensed under CC BY-SA. the current timestamp, which you can get from the JavaScript. rev2023.4.21.43403. How to append HTML code to a div using JavaScript ? You could set this up as a function fired by a button press or however you want to in iframe1. I have a JS plug in and it will have a variable called newURL ready and this newURL is another aspx page. Reload an iframe with HTML (no Java Script req.) Is it possible to apply CSS to half of a character? I initially set out to try and save some time with RWD and cross-browser testing. Limiting the number of "Instance on Points" in the Viewport. How to convert a sequence of integers into a monomial. javascript - change src of iframe and then reload the iframe - Stack By clicking Post Your Answer, you agree to our terms of service, privacy policy and cookie policy. Maybe add a dynamic GET parameter f.e. How to combine several legends in one frame? To subscribe to this RSS feed, copy and paste this URL into your RSS reader. Is the iframe document on a different domain? So, instead of looking at navigator.AppName, why not do something like this, actually testing for the elements you use? Cool tutorial on how to change the iframe src attribute value using JavaScript. What does 'They're at four. I have it check a server side variable that I set, so it does not try to run the JavaScript function in iframe2 unless I have taken a specific action in iframe1. Examples might be simplified to improve reading and learning. If you using Jquery then there is one line code. The only solution I can find is to set the src to a blank screen, then onload set it to the new url: This works, yet it seems inefficient because there's an extra step. Required fields are marked *. This does not reload the new source as the poster asked. The following syntax is work for both cases, where the IFrame is provided & loaded from the same domain, and where the IFrame is not from the same domain. Just reciprocating Alex's answer but with jQuery: this is useful especially when