JSFiddle - React, Tailwind, and code Playground
HTML
<iframe id="myFrame" src="http://google.com"></iframe><br/>
<input id="uxButton" type="button" value="Reload the frame" />
JavaScript
$(document).ready(function() {
var iFrame = $('#myFrame');
iFrame.bind('load', function() { //binds the event
alert('iFrame Reloaded');
});
$('#uxButton').click(function() {
alert('onButtonClick OR onBeforeReload');
var newSrc = iFrame.attr('src') + '?c=' + Math.random(); //force new URL
iFrame.attr('src', newSrc); //changing the src triggers the load event
});
});