jQuery replacement for .load()?

702 Views Asked by At

I'm stuck with my stuff here, 'cause it has been developed by one of my former colleagues.

It's all about the following line:

$("#selector").load(helper.GetID() + "/Shop/Payment", data, function () { .... })

As .load() is deprecated, what would be the correct new line for this? I've already tried

$("#selector").on("load", helper.GetID() + "/Shop/Payment", data, function () { .... })

but this does not seem to work for me. Can anyone help?

1

There are 1 best solutions below

1
On BEST ANSWER

Using load() as an event handler is deprecated.

Using load() to retrieve external content - which is what you're doing - is absolutely fine. You do not need to amend your code at all.