Quantcast
Channel: Yii Framework Forum
Viewing all articles
Browse latest Browse all 18717

Live In On Jquery

$
0
0
Ciao a tutti!

Avrei un problema con jQuery, per vari motivi ho dovuto aggiornare la versione di jquery nel progetto, il problema è che nella nuova versione il .live() non è più in uso.

Il fatto è che nel form mi ha generato questo script:

jQuery('#yw0_button').live('click',function(){
jQuery.ajax({
url: "\/...\/index.php\/registration\/captcha?refresh=1",
dataType: 'json',
cache: false,
success: function(data) {
jQuery('#yw0').attr('src', data['url']);
jQuery('body').data('captcha.hash', [data['hash1'], data['hash2']]);
}
});
return false;
}); 


che mi genera un errore di questo tipo: TypeError: jQuery(...).live is not a function

Come faccio a cambiare il .live in .on?

Grazie mille,
ciao!

Viewing all articles
Browse latest Browse all 18717

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>