首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 网站开发 > Web前端 >

jquery.from 跨域有关问题。做个记录

2012-11-23 
jquery.from 跨域问题。做个记录if(opts.mitType && opts.mitTypeuplaodFile){//if (cbInvoked++) retu

jquery.from 跨域问题。做个记录
if(opts.mitType && opts.mitType=="uplaodFile"){
            //if (cbInvoked++) return;
            var ok = true;
            try {
                if (opts.dataType == 'json' || opts.dataType == 'script') {
                    if (opts.dataType == 'json'){
                    if (state === 1) {
                   
                             var data = io.contentWindow.name;    // 返回内容放在window.name中
                             if (ok) {
                                 opts.success(eval("("+data+")"), 'success');
                                 if (g) $.event.trigger("ajaxSuccess", [xhr, opts]);
                             }
                            io.detachEvent ? io.detachEvent('onload', cb) : io.removeEventListener('load', cb, false);
                            setTimeout(function() {
                           $io.remove();
                           xhr.responseXML = null;
                        }, 100);
                         } else if (state === 0) {
                             state = 1;
                             io.contentWindow.location = "/web4s/common/plug/jquery/proxy.jsp";    //代理jsp
                             return false;
                         }
                    }else{
                        $.globalEval(data);
                    }
                }
            }
            catch(e){
                ok = false;
                $.handleError(opts, xhr, 'error', e);
            }
        }

热点排行