Advertisement
Guest User

Untitled

a guest
Apr 21st, 2015
198
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.17 KB | None | 0 0
  1. $(document).ready(function () {
  2.  
  3. $('#link').click(function() {
  4. $.ajax({
  5. url: "http://localhost:8085/KPIAdmin/kpis/get",
  6. type: "GET",
  7. data: {
  8. param1: "value1",
  9. param2: "value2"
  10. },
  11. success: function() {
  12. alert("Success!");
  13. },
  14. error: function (jqXHR, textStatus, errorThrown) {
  15. console.log(jqXHR);
  16. console.log(textStatus);
  17. console.log(errorThrown);
  18. },
  19. });
  20. });
  21.  
  22. });
  23.  
  24. @RequestMapping(value="/get", method=RequestMethod.GET)
  25. public void ajaxGetKPI(@RequestParam("param1") String param1, @RequestParam("param2") String param2) {
  26.  
  27. System.out.println("param1: " + param1);
  28. System.out.println("param2: " + param2);
  29. }
  30.  
  31. Object { readyState: 4, getResponseHeader: .ajax/v.getResponseHeader(), getAllResponseHeaders: .ajax/v.getAllResponseHeaders(), setRequestHeader: .ajax/v.setRequestHeader(), overrideMimeType: .ajax/v.overrideMimeType(), statusCode: .ajax/v.statusCode(), abort: .ajax/v.abort(), state: .Deferred/d.state(), always: .Deferred/d.always(), then: .Deferred/d.then(), 11 weitere… } ajaxGetKPI.js:24
  32. "error" ajaxGetKPI.js:25
  33. "Not Found"
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement