Project

General

Profile

« Previous | Next » 

Revision d06201a3

Added by Vinícius Coque almost 14 years ago

Convert dashboard ajax code from Prototype to jQuery

View differences:

usr/local/www/index.php
261 261
	uri = "widgets/widgets/" + widget + ".widget.php";
262 262
	var opt = {
263 263
	    // Use GET
264
	    method: 'get',
264
	    type: 'get',
265 265
		evalScripts: 'true',
266
	    asynchronous: true,
266
	    async: true,
267 267
	    // Handle 404
268
	    on404: function(t) {
269
	        alert('Error 404: location "' + t.statusText + '" was not found.');
268
	    statusCode: {
269
	        404: function(t) {
270
	            alert('Error 404: location "' + t.statusText + '" was not found.');
271
	        }
270 272
	    },
271 273
	    // Handle other errors
272
	    onFailure: function(t) {
274
	    error: function(t) {
273 275
	        alert('Error ' + t.status + ' -- ' + t.statusText);
274 276
	    },
275
		onSuccess: function(t) {
277
		success: function(data) {
276 278
			widget2 = widget + "-loader";
277 279
			Effect.Fade(widget2, {queue:'front'});
278 280
			Effect.Appear(widget, {queue:'end'});			
281
			jQuery('#' + widget).html(data);
279 282
	    }	
280 283
	}
281
	new Ajax.Updater(widget, uri, opt);
284
	jQuery.ajax(uri, opt);
282 285
}
283 286

  
284 287

  

Also available in: Unified diff