Load event for iFrame not fired in IE

前端 未结 7 1531
无人及你
无人及你 2020-12-09 02:46

Why is the load event not fired in IE for iFrames?

Please take a look at this example.

Work perfectly as expected in FF and Chrome, but IE fails

7条回答
  •  无人及你
    2020-12-09 03:43

    Add the prefix "iframe" in front of your id:

    $('iframe#myFrame').load(function() {
      ...
    });
    

    Alternativly try to use "ready" instead of "load":

    $('#myFrame').ready(function()  {
        alert("Loaded");
    });
    

    This should work.

提交回复
热议问题