Reload IFrame Url using Jquery

Reload IFrame Url using Jquery

Added by Nasir Mahmood updated on Friday, November 17, 2017


Previously while working on Online Razor Editor I need to use IFrame for page preview, since code and preview are in separate tabs, so I decided to reload iframe contents on tab shown event. Now problem was how I can do this from client side using jquery? I search on net and found a solution here

This is modified and compact code of original solution.

$( '#iframe' ).attr( 'src', function () { return $( this )[0].src; } );

Related Tags


32 Tutorials
27 Snippets
6 Products


Contact Us

Contact us

Stay Connected