Click here to Skip to main content
15,743,299 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
Use the iframe tags in HTML 5, through the button event after modifying the iframe SRC attribute, can refresh the iframe; But through external JavaScript function called, after the modification of the SRC ,The SRC value is the machine under the other files in the HTML file,but cannot refresh iframe; I hava try more method,but no use. So, Is there any other method to enforce refresh iframe?Thank you for your help.

What I have tried:

I hava try a lot of method to refresh iframe,but failed.The Attribute of src have changed success.
Updated 15-Aug-16 7:33am
Karthik_Mahalingam 16-Aug-16 0:25am    
document.getElementById('youriframeid').src = 'new url'
this should work
Lee Yuan 16-Aug-16 10:59am    
This method has been tried, but still can't refresh the page.

1 solution

If you wrap your <iframe> in a <div>, you can update the div (via AJAX[^]) with the new <iframe>> content. I do this all the time to simulate tabbing.
Share this answer

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900