Ajax Question |
When I keyup on my input it runs the ajax
But on success it creates a class called well multiple times as shown in image below How can I make sure it only creates one class only even when keyup. Code: $('input[name=\'tags\']').on('keyup', function(e){
There's only one rule - please don't tell anyone to go and read the manual. Sometimes the manual just SUCKS!
I think I don't understand your problem.
You are using on('keyup'), which fires the ajax routine every time you release a key on your keyboard. So when you type 'city', it is fired 4 times. If you use one('keyup'), the same happens, but only once. So the <p class="well"></p> will be inserted after your input just once. |
Welcome Guest, Not a member yet? Register Sign In |