Menü schliessen
Created: January 6th 2021
Last updated: January 6th 2021
Categories: IT Development,  Wordpress
Author: Marcus Fleuti

[solved] Wordpress-Backend is not saving / JQuery $().live is not a function

Tags:  1.9,  click,  deprecated,  error,  jQuery,  on,  wordpress
Donation Section: Background
Monero Badge: QR-Code
Monero Badge: Logo Icon Donate with Monero Badge: Logo Text
82uymVXLkvVbB4c4JpTd1tYm1yj1cKPKR2wqmw3XF8YXKTmY7JrTriP4pVwp2EJYBnCFdXhLq4zfFA6ic7VAWCFX5wfQbCC

Problem

The user working in the WordPress-Backend isn't able to save his post and the following error happens:

TypeError: $(...).live is not a function

Solution

jQuery.live() has been removed since version 1.9 and is not longer supported. To fix this issue you need to change your code from:

$(selector).live("click", function() {
   alert("Hello World!");
});

to:

$(selector).on("click", function() {
   alert("Hello World!");
});

or:

$(selector).click(function(){
   alert("Hello World!");
});