0

当我调用 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');
}
4

1 回答 1

0

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

您优先于 cookie 而不是传递给函数的值。更改顺序以优先考虑传递给函数的值

于 2018-08-16T06:56:10.303 回答