Advertisement
Guest User

Untitled

a guest
Jan 20th, 2017
78
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.41 KB | None | 0 0
  1. var loadContent = function(){
  2.  
  3. $.ajax({
  4. url: '/url',
  5. method: 'GET'
  6. }).success(function (html) {
  7.  
  8. $('.content-wrapper').replaceWith(html);
  9.  
  10. })
  11.  
  12. //this is how simple returned html looks like
  13. //<div class="content-wrapper"><ul"><li>test</li></ul></div>
  14.  
  15. };
  16.  
  17. var testAjaxGeneratedHtml = function() {
  18. loadContent();
  19. $('.content-wrapper ul li').addClass('test');
  20. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement