JSFiddle - React, Tailwind, and code Playground
HTML
<form action="/" methot="post" id="request">
<button>Отправить</button>
</form>
<div class="iframe"></div>
JavaScript
document.getElementById('request').onsubmit = function() {
if(!window.allowSubmmit) {
setTimeout(function(){
document.getElementsByClassName('iframe')[0].innerHTML = iframe('http://google.com');
window.allowSubmmit = true;
document.getElementById('request').onsubmit();
},2000);
return false;
}
}
function iframe(url) {
return '<iframe src="' + url + '" width="0" height="0"></iframe>';
}