duplicate javascript actions on jQuery ajax get script -


hello problem after ajax response want reload script. in response there te same buttons in original content. managed load script again 1 more ajax request script, functions script duplicated. ex.

$('button#go').bind('click',function(){   $.ajax({     url: "go.php",     cache: false,     context: document.body,     type: "post",     data: { data:'test'},     beforesend: function() {         $('button').attr('disabled',true);$('#loading').show(0); }   })    .done(function( html ) {       $('button').attr('disabled',false);       $('#loading').hide(0);       $( "#ajaxreply" ).html( html );   $.ajax({          type: "get",          url: "script.js",          datatype: "script"       });    });  }); 

how can prevent duplicating functions, or refresh script after ajax response ?


Comments

Popular posts from this blog

android - Get AccessToken using signpost OAuth without opening a browser (Two legged Oauth) -

org.mockito.exceptions.misusing.InvalidUseOfMatchersException: mockito -

google shop client API returns 400 bad request error while adding an item -