EXTJS - Simple ajax request with callback and json to object deserialization


/ Published in: Other
Save to your folder(s)



Copy this code and paste it in your HTML
  1.  
  2. /**
  3. * Simple ajax request with callback and json to object deserialization
  4. */
  5.  
  6. simpleAjax = function () {
  7.  
  8. var received = function (response) {
  9. x = Ext.decode( response.responseText );
  10. //console.log(x);
  11. console.log(this);
  12. }
  13.  
  14. Ext.Ajax.request({
  15. url: '/files/ux/RemoteComponent/implementation4/grid_generated.php',
  16. success: received,
  17. failure: function () { console.log('failure');},
  18. headers: {
  19. 'my-header': 'foo'
  20. },
  21. params: { foo: 'bar' }
  22. });
  23.  
  24. } // eo function

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.