Using Toggle with jQuery / ajax -


what i'm trying toggle. onclick event set in html. external div loaded onclick opens (appended). when click link again it's appended again. wrong. want close. open , close. keeping onclick event in html. how????

here's code...

 (function($){      $.am_get_item = function (item_id, size_id){         $.ajax({ url: "/order/item/" + item_id + "/" + size_id, success: function(data){             $(".item_form").hide();             $(data).find("#show_item").appendto("#form_" + item_id);             $("#form_" + item_id).slidedown("slow");             $("input#form1").keyup(function () {var value = $(this).val();$("div#ok").text(value);}).keyup();         }});             } })(jquery); 


Comments

Popular posts from this blog

python - Scipy curvefit RuntimeError:Optimal parameters not found: Number of calls to function has reached maxfev = 1000 -

c# - How to add a new treeview at the selected node? -

java - netbeans "Please wait - classpath scanning in progress..." -