jQuery: Ajax Tips

Alexander Farkas beschreibt im t3n Magazon jQuery-Lösungen für typische Ajax-Probleme.

Da sind einige nette Code-Schnipsel bei, z.B.:

Einfaches Ajax-Fehlerlogging (das verwendete „setTimeout“ führt dazu, dass die Ausführung des übrigen Codes nicht durch „throw“ unterbrochen wird. )

$(document).ajaxError(function(e, xhr, opts, err){
	var status = (xhr || {}).status;
	xhr = null;
	setTimeout(function(){
		throw(e.type +' | '+ status +' | '+ opts.url);
	}, 0);
});

Possibly related posts (automatically generated)