Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/jquery/80.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Javascript 引导选择在“已更改”激发事件中不返回值_Javascript_Jquery_Html_Bootstrap Select - Fatal编程技术网

Javascript 引导选择在“已更改”激发事件中不返回值

Javascript 引导选择在“已更改”激发事件中不返回值,javascript,jquery,html,bootstrap-select,Javascript,Jquery,Html,Bootstrap Select,使用事件 回调函数中的“newValue”和“oldValue”没有返回任何值,它们分别返回true和false,但是根据上面链接中的文档,它们应该返回值,对吗 $'instructorLocationRadius'.off'changed.bs.select'.on'changed.bs.select',functionevent,单击索引、newValue、oldValue{ scope.locationDistanceSearched=newValue;//newValue返回true

使用事件

回调函数中的“newValue”和“oldValue”没有返回任何值,它们分别返回true和false,但是根据上面链接中的文档,它们应该返回值,对吗

$'instructorLocationRadius'.off'changed.bs.select'.on'changed.bs.select',functionevent,单击索引、newValue、oldValue{ scope.locationDistanceSearched=newValue;//newValue返回true }; 2英里 5英里 8英里 15英里 25英里 试用

$('#instructorLocationRadius').on('changed.bs.select', function(event, clickedIndex, newValue, oldValue) {
  scope.locationDistanceSearched = newValue; // newValue is returning true
});

删除.off不会影响返回的值在项目上是否有引导选择的cdn?使用JSFIDLE不确定我是否正确地阅读了文档,但我通过使用this.value而不是newValue获得了值……很高兴听到这个消息:也许这会有所帮助