Pastie now auto-senses if line-wrap is a bad or good idea. Feedback?
## mark a section (Learn more)
var SyncleonAJAX = new Class( { /** * Initializes the class, and sets properties. */ initialize : function(url) { this.url = url; this.list = $('todo'); this.details = $('todo-details'); }, /** * Attaches the event to the list. */ attachEvents : function() { this.list.addEvent('change', this.getDetails.bind(this)); }, /** * Retrieves the data from the Joomla model using a HTTP call. */ getDetails : function() { var id = this.list.getProperty('value'); var details = this.details; var request = new Json.Remote(this.url + "&id=" + id, { onComplete : function(todo) { details.setHTML(todo.body); } }).send(); } });
This paste will be private.
From the Design Piracy series on my blog: