Guest User

Untitled

a guest
Dec 10th, 2016
60
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.54 KB | None | 0 0
  1. $.get(
  2. '/myviewpage',
  3. {myfield=14},
  4. function(data){ $('#SomeOtherDiv').html(data) }
  5. );
  6.  
  7. function getInfo(args) {
  8. $.ajax({
  9. url: '/views/ajax',
  10. type: 'post',
  11. data: {
  12. view_name: 'your_view_name',
  13. view_display_id: 'block_1', //your display id
  14. view_args: args,
  15. },
  16. dataType: 'json',
  17. success: function (response) {
  18. if (response[1] !== undefined) {
  19. var viewHtml = response[1].data;
  20. $('#myDiv').html(viewHtml);
  21. Drupal.attachBehaviors(); //check if you need this.
  22. }
  23. }
  24. });
  25. }
Add Comment
Please, Sign In to add comment