Advertisement
Guest User

Untitled

a guest
Mar 24th, 2017
57
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.73 KB | None | 0 0
  1. $("#draftImg").click(function () {
  2.  
  3. $.ajax({
  4. url:"/rest/report/listReportName?userId=999",
  5. dataType: 'json',
  6. type: 'GET',
  7. success: function(data) {
  8.  
  9. $('#olSavedReports').empty();//div to show the list
  10. var items = [];
  11.  
  12. $.each( data, function( index, value ) {
  13. items.push('<li><a href="/rest/report/getReport?userId=999&reportId=' + value.reportId + '">' + value.reportName + '</a></li>');
  14. });
  15.  
  16. $('#olSavedReports').append( items.join('') );
  17. },
  18.  
  19. error: function() {
  20. console.log('An error has occured in ajax call!!');
  21. }
  22. });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement