Error typeerror: $(…). Live is not a function solution

The reason for the error is that this method was abolished after jQuery 1.7

The. On () method is used in versions after 1.7

Previous usage:

.live(events, function)  

New method:

.on(eventType, selector, function)

Exaple:

Before:

$('#myid').live('click', function{
 
	alert(1)
 
})

After:

$('body').on('click', '#myid', function{
 
	alert(1)
 
})

 

Similar Posts: