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

Popular posts from this blog

java - Play! framework 2.0: How to display multiple image? -

gmail - Is there any documentation for read-only access to the Google Contacts API? -

php - Controller/JToolBar not working in Joomla 2.5 -