在你要触发的按钮下加点击事件输入以下代码:
$.ajax({
url:"你的接口",
type: 'get',
timeout:3000,
//async : false,
scriptCharset: 'UTF-8',
dataType:'json',
success:function (data,textStatus) {
let token = data.token;
link(token);
},
error: function(XMLHttpRequest, textStatus, errorThrown){
},
complete: function(XMLHttpRequest, textStatus){
}
});
function link(token){
var iframe = $("
iframe.attr("src","$你的链接&token="+token); //复制之后记得修改路径
var o = { width :800, //对话框宽度
height: 400 //对话框高度
};
FR.showDialog("编辑", o.width, o.height, iframe,o);//弹出对话框
}
你返回来的数据看一下能不能直接.token获取到,不行的话就用eval()转一下