Advertisement
Guest User

Untitled

a guest
Mar 28th, 2015
244
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.47 KB | None | 0 0
  1. var request = Class.extend({
  2.  
  3. response: "",
  4.  
  5. init: function(url) {
  6. this.url = url;
  7. },
  8.  
  9. process: function() {
  10.  
  11. $.get( "http://framework.dev/ajax.php", function( data ) {
  12. var obj = jQuery.parseJSON( data);
  13. console.log(obj);
  14.  
  15. this.response = obj;
  16. }).done(function(data){
  17. //
  18. });
  19.  
  20. }
  21.  
  22. });
  23.  
  24. var request = new request('ajax.php');
  25. console.log(this.response);
  26.  
  27. $('#test').on('click', function(){
  28. console.log(request.process());
  29. });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement