unload ajax when just closing a jquery ui dialog

i'm using this technique to load ajax into a jqueryui dialog [load ajax dialog technique][1] it works fine except for one this with my in my implementation i have a calculation that i have put in the "complete" section... options.complete = function(){ $("#quantity").bind("keyup", function () { var sum = 0; price = $('#price').val(); qty = $('#quantity').val(); sum = price*qty; $('.total').text(sum); }); } That works fine on the first load every time. If i refresh it works like a charm. I even tried the live method. like this.... options.complete = function(){ $("#quantity").live("keyup", function () { var sum = 0; price = $('#price').val(); qty = $('#quantity').val(); sum = price*qty; $('.total').text(sum); }); } using the live method i get some interesting if i alert out a alert('here') at the top of the function. each time i open and close the dialog and change the number in the quantity i get as many alerts as the amount of times that i have opened and closed the dialog ie : open and close the dialog 3 times and i get 3 alerts....open it 5 times i get 5 alerts etc etc. what i need to know is if there is a way to completely unload the ajax from the DOM with the jquery ui dialog beforeClose: method. Thanks in advance. Scott oops forgot to put this in as well... "Cancel": function() { $(this).dialog("destroy"); } also does not work. [1]: http://8raystech.com/2011/06/28/how-to-dynamic-content-in-a-jquery-ui-dialog-by-loading-a-url-via-ajax

以上就是unload ajax when just closing a jquery ui dialog的详细内容,更多请关注web前端其它相关文章!

赞(0) 打赏
未经允许不得转载:web前端首页 » jQuery 答疑

评论 抢沙发

  • 昵称 (必填)
  • 邮箱 (必填)
  • 网址

前端开发相关广告投放 更专业 更精准

联系我们

觉得文章有用就打赏一下文章作者

支付宝扫一扫打赏

微信扫一扫打赏