1
|
function WMPAjaxUpload(){var o=this;this.frame=function(n){var e="f"+Math.floor(99999*Math.random());return jQuery("body *:first",window.document).before('<div><iframe style="display:none" src="about:blank" id="'+e+'" name="'+e+'"></iframe></div>'),jQuery("#"+e,window.document).bind("load",function(){o.loaded(e)}),n&&"function"==typeof n.onComplete&&(jQuery("#"+e,window.document).get(0).onComplete=n.onComplete),e},this.form=function(o,n){jQuery(o).attr("target",n)},this.dosubmit=function(n,e){return o.form(n,o.frame(e)),!e||"function"!=typeof e.onStart||e.onStart()},this.loaded=function(o){if(jQuery("#"+o,window.document).get(0).contentWindow)var n=jQuery("#"+o,window.document).get(0).contentWindow.document;else if(jQuery("#"+o,window.document).get(0).contentDocument)n=jQuery("#"+o,window.document).get(0).contentDocument;else n=window.frames[o].document;"about:blank"!=n.location.href&&"function"==typeof jQuery("#"+o,window.document).get(0).onComplete&&jQuery("#"+o,window.document).get(0).onComplete(n.body.innerHTML)}}
|