Prototype Ajax Request


/ Published in: JavaScript



Copy this code and paste it in your HTML
  1. //Make the AJAX call
  2. var url = '';
  3. var params = encodeURI('');
  4. new Ajax.Request(url, {
  5. asynchronous: true,
  6. method: "get",
  7. parameters: params + 'type=eval',
  8. onSuccess: function(request){
  9. //evaluate
  10. eval(request.responseText);
  11. },
  12. onFailure: function(request){
  13.  
  14. }
  15. });

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.