手记

ajax 跨域请求

         $.ajax({               type : "get",               async:false,              url: pdbasefurl+"tourist/getToken.action",                dataType : "jsonp",//数据类型为jsonp               jsonp: "jsonpCallback",//服务端用于接收callback调用的function名的参数               success : function(data){              iczoomtokenname=data.result.split(",")[0];            iczoomtokenvalue=data.result.split(",")[1];            var pdfurls=null            if($(".defaultpdfurl").val().indexOf("images/public/basicproduct")>-1){                 pdfurls =$(".defaultpdfurl").val()+"?"+iczoomtokenname+"="+iczoomtokenvalue+"&iczoomtokenname="+iczoomtokenname        }else{            pdfurls =$(".defaultpdfurl").val()        }         $("#displayPdfIframe").attr("src",pdbasefurl+"iczoompdf.html?file=" + encodeURIComponent(pdfurls));                     },               error:function(){                   alert('pdf 不存在');               }           });

0人推荐
随时随地看视频
慕课网APP