var JQueryAgent = function() { this._init(); } JQueryAgent.prototype = { _init: function() { }, _do_call: function(sync, args) { var remote_function = args[0]; var callback = null; var params = new Array(); for (var i = 1; i < args.length; i++) { if (typeof(args[i]) == 'function') { callback = args[i]; } else { params.push(args[i]); } } jQuery.ajax({ url: "/secteur_bien/Aix+En+Provence,Alpilles,Avignon,Cevennes+&+Languedoc,Corse,Cote+&+Pays+Varois,Cote+D+azur,Drome+&+Ventoux,Grimaud+-+Sainte+Maxime,Haute+Provence,Luberon,Lyon,Marseille+&+Littoral,Saint+Tropez,Uzes+&+Camargue_1__Location/immobilier-aix-en-provence-alpilles-avignon-cevennes-languedoc-corse-cote-pays-varois-cote-d-azur-drome-ventoux-grimaud-sainte-maxime-haute-provence-luberon-lyon-marseille-littoral-saint-tropez-uzes-camargue.html?secteur=South-East", async: !sync, type: "POST", data: {jquery_aa_afunc: "call", remote_function: remote_function, params: params}, success: function(cb, resp) { if (cb) { var res; try { res = jQuery.parseJSON(resp); if (res === false) { res = resp; } } catch (e) { res = resp; } cb(res); } }.bind(null, callback) }); }, call: function() { this._do_call(false, arguments); }, sync_call: function() { this._do_call(true, arguments); } } var jquery_agent = new JQueryAgent(); if (typeof(jquery_agent) == 'undefined') jquery_agent = jquery_agent;