I press button after that appears div in which shows "loading" and loads iframe. So, showing div I can do via jQuery, but how to load iframe after event?
質問する
1945 次
2 に答える
3
Set the src
attribute of the iframe the moment you want it to start loading (set it to ""
by default):
$('#my-button').click(function() {
$('iframe#myIframe').attr('src', url);
});
You can also handle events for when the iframe finishes loading:
$('iframe#myIframe').load(function() {
// do stuff...
});
于 2012-08-11T19:36:17.127 に答える
1
So I understood what I needed:
<iframe id="chgMe" src="Source1.htm">Frames are not supported on your browser.</iframe>
<button onclick="document.getElementById('chgMe').src='Source2.htm'">Next</button>
于 2012-08-12T18:21:30.687 に答える