-2

Intialy i was working with Jquery version 1.9 then below code worked as expected, the alert is shown after complete iframe load.

$("iframe["iframe1"]").load( function () {alert("Hello"});

But After updating to version 3.1, alert is shown right after iframe is loaded, I mean complete page is not loaded in the iframe but alert is shown.

Now if I change the function then it is working fine.

$("iframe["iframe1"]").on("load", function () {alert("Hello"});

Can anyone help me to know , what changes introduce in new jQuery.

Ajay Narain Mathur
  • 5,326
  • 2
  • 20
  • 32
pardeepgarg
  • 82
  • 1
  • 8

1 Answers1

0

.load() method removed starting from version 3 as it conflicted with ajax .load(). instead you can use .on("load", fn) as you did

Evon Dos
  • 155
  • 1
  • 3