Advertisement
Guest User

Untitled

a guest
Apr 27th, 2017
50
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.48 KB | None | 0 0
  1. $.ajax({
  2. url: target_file,
  3. beforeSend: function(){
  4. // triggered before the ajax-call is made
  5. }
  6. }).done(function(data){
  7. // triggered when ajax-call is done, the loaded file is stored in data-variable
  8. // load specific element (content) from the data into specific element (container):
  9. $("#container_element").html($(data).find('#content_element'));
  10. }).fail(function(){
  11. // triggered when error during ajax-call
  12. }).always(function(){
  13. // always triggered, no matter if success or fail
  14. });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement