Never been to TextSnippets before?

Snippets is a public source code repository. Easily build up your personal collection of code snippets, categorize them with tags / keywords, and share them with the world (or not, you can keep them private!)

« Newer Snippets
Older Snippets »
1 total  XML / RSS feed 

Debugging RJS

<script>
Ajax.Responders.register({
  // log the beginning of the requests
  onCreate: function(request, transport) {
    new Insertion.Bottom('debug', '<p><strong>[' + new Date().toString() + '] accessing ' + request.url + '</strong></p>')
  },

  // log the completion of the requests
  onComplete: function(request, transport) {
    new Insertion.Bottom('debug', 
    '<p><strong>http status: ' + transport.status + '</strong></p>' +
    '&lt;pre>' + transport.responseText.escapeHTML() + '&lt;/pre>')
  }
});
</script>

<div id="debug"></div>
« Newer Snippets
Older Snippets »
1 total  XML / RSS feed