Хабр Курсы для всех
РЕКЛАМА
Практикум, Хекслет, SkyPro, авторские курсы — собрали всех и попросили скидки. Осталось выбрать!
that[methods[index]] = (function (name) {
return function () {
request.push('"' + name + '":' + that.methods(arguments));
if (!timer) { /* ... */ }
};
})(methods[index]);
function makeMethod(method){
return function(){
request.push('"' + method + '":' + that.methods(Array.prototype.slice.call(arguments)));
if (!timer)
...
}
}
this.add = function(res){
var methods = eval('{' + res.responseText + '}');
for (var index in methods)
that[methods[index]] = makeMethod(methods[index]);
}
this.ajax_run=function(req){
eval('var ret='+req.responseText);
for (var i in func){
if (func[i])
func[i](ret);
}
request=[];
func=[];
timer=false;
}
JS-PHP MVC интерфейс — cобираем всё вместе