X-Git-Url: http://git.asbjorn.biz/?a=blobdiff_plain;f=ajax%2Fajax.js;h=21a993498c5e2c43220a0bc613e8eaa3e728d1f6;hb=582075e965a7df985aede0e088928c486fe9ce06;hp=98569e17a91bb66b31111a0db27e0ac2a53bafa6;hpb=66565227051d2e1a066268fe1a7416b3d304e602;p=jquery.git diff --git a/ajax/ajax.js b/ajax/ajax.js index 98569e1..21a9934 100644 --- a/ajax/ajax.js +++ b/ajax/ajax.js @@ -120,18 +120,15 @@ $.fn.load = function(a,o,f) { t = "POST"; } var self = this; - $.xml(t,a,o,function(h){ - // Get HTTP data - h = $.httpData(h); - + $.xml(t,a,o,function(res){ // Assign it and execute all scripts - self.html(h).find("script").each(function(){ - try { $.execute( this.text || this.textContent || this.innerHTML || ""); } catch(e){} + self.html(res.responseText).find("script").each(function(){ + try { eval( this.text || this.textContent || this.innerHTML || ""); } catch(e){} }); // Callback function if (f && f.constructor == Function) - f(h); + f(res.responseText); }); return this; }; @@ -319,22 +316,8 @@ $.fn.putForm = function(target, pre_cb, post_cb, url, mth) { $(target).load(url, this.vars, post_cb); } else { this.vars.push({name: 'evaljs', value: 1}); - $.xml(mth, url, $.param(this.vars), function(r) { $.execute(r.responseText); }); + $.xml(mth, url, $.param(this.vars), function(r) { eval(r.responseText); }); } return this; } - -// ------------------------------------------------------ - -$.fn.changer = function(form, target, pre_cb, post_cb) { - $(form).submit(function(e) { - e.preventDefault(); - return false; - }); - this.change(function(e) { - e.preventDefault(); - $(form).getForm().putForm(target, pre_cb, post_cb); - return this; - }); -} \ No newline at end of file