Javascript - 如何更新 cookie 以便它拨打新号码而不是默认号码?

Javascript - how to update the cookie so that it dial new number instead of the default number?

当我调用 manual_dial() 时,它总是拨 12127773456 而不是 32448899000。为什么 pop 方法不更新 cookie verto_demo_ext

有什么建议吗?

// Cookie library
// https://freeswitch.org/stash/projects/FS/repos/freeswitch/raw/html5/verto/video_demo/js/jquery.cookie.js?at=67dad0639867bbc64fa404b30caad2889ea80899

var dial______________________number = '12127773456';
function pop(id, cname, dft) {
  var tmp = $.cookie(cname) || dft;
  $.cookie(cname, tmp, {
    expires: 365
  });
  $(id).val(tmp).change(function () {
    $.cookie(cname, $(id).val(), {
      expires: 365
    });
  });
}

function init() {
  pop("#ext", "verto_demo_ext", dial______________________number);
}

function manual_dial() {
  pop("#ext", "verto_demo_ext", '32448899000');
}

将行 var tmp = $.cookie(cname) || dft; 更改为 var tmp = dft || $.cookie(cname);

您优先选择 cookie 而不是传递给函数的值。将顺序更改为优先传递给函数的值