I was using the live() function:
$('a.remove_item').live('click',function(e) {});
I needed to change this to one() to prevent multiple clicks, however when I inject one of these elements after the page has loaded the one() listener does not fire.
How can I get one() to behave like live()?
Try this:
This executes your code, but it also sets a flag ‘oneclicked’ as yes, so that it will not activate again. Basically just sets a setting to stop it from activating once it’s been clicked once.