javascript - Something with callback -
already 15 minutes can not understand
if(send == true){ $.getscript('index.php?get_names_from_ajax=true', function(data){ $('#firstnames').remove(); $('#lastnames').remove(); $('#content').prepand('<div class="block" id="firstnames">'+firstnames+'</div>'); $('#firstnames').after('<div class="block" id="lastnames">'+lastnames+'</div>'); send = false; }); alert(send); } getscript works fine, callback gives no results.
edit
as said, callback off, nothing removes or adds, no moving, there no callback.
i think firstnames , lastnames should data.firstnames , data.lastnames, if not defined in script before.
$.getscript('index.php?get_names_from_ajax=true', function(data){ $('#firstnames, #lastnames').remove(); $('#content').prepand('<div class="block" id="firstnames">'+data.firstnames+'</div>'); $('#firstnames').after('<div class="block" id="lastnames">'+data.lastnames+'</div>'); send = false; });
Comments
Post a Comment