同一个html调用两个JS文件A和B,但是B页面只能拿到一个值,is_agent的值取不到

同一个html调用两个JS文件A和B,但是B页面只能拿到一个值,is_agent的值取不到
A页面调接口从后台取得值,项目是vue和jq的结合体,所以我在想是不是is_agent: false, 影响的

var vm = new Vue({
data:{
is_agent: false, 
}
})

$(function () {
    var data = {
        "mode": mode,
    }
    $.ajax({
        url: commonurl + 'query/appinfo',
        data: JSON.stringify(data),
        type: 'POST',
        timeout: 30000,
        dataType: 'json',
        contentType: "application/json",
        headers: securityHeaders,
        success: function (data) {
               // is_agent= true; 怕上面vue中的data影响写的,但是好像没什么用处
               var is_agent = data.applicant.is_agent
                console.log("first",is_agent)
                goShare(is_agent,product_code);
         }

B页面 is_agent显示为NaN

function goShare() {
   console.log("客户", is_agent);
   console.log("产品", product_code);
}

img


或者第二种方法如何取到is_agent的值,在B页面用data会报错

product_code = data.product_code;
console.log("first",data.applicant.is_agent)
goShare(data.applicant.is_agent,product_code);

请问一下B页面怎么接收参数,因为我写了形参但是也报错,写data.applicant.is_agent,也报错说data未定义

形参要保留,因为你函数要接收参数。另外,看一下我这个图,打印这些出来观察一下看看

img