function bind(pageIndex) {
if (getQueryString("_status") == "3") {//从首页中慢病管理人数进入页面
$('#selStatus option:eq(2)').attr('selected', 'selected')
} else if (getQueryString("_status") == "2") {//从慢病管理待定信息进入
$('#selStatus option:eq(1)').attr('selected', 'selected')
} else {//从左侧树形结构进入
$('#selStatus option:eq(0)').attr('selected', 'selected')
}
var _status = $("#selStatus").val();//状态
//其他.........
}
<select class="form-control m-bot15" id="selStatus" onchange="bind(0)">
  <option value="1">系统默认</option>
  <option value="2">待 定</option>
  <option value="3">确 诊</option>
  <option value="4">康 复</option>
</select>

工作中遇到这样的现象,如上述代码。

一个函数,绑定在select中onchange事件中。

此页面从不同的地方进入呢,它的状态是不同的,所以根据从不同的地方进入设置了固定的选中的option。。

在chrome,ie,Firefox中呢不会有任何的问题,感觉很完美的样子。。

然而,然而在 360浏览器中,会发生点击select切换option失效,切换不了啊,怎么选都是最开始进入页面的那个状态呀。。

这可咋办!!

脑仁疼之后恢复了冷静,找原因呀。。

哦,找到了!

看我贴的那段js代码,

我把根据不同入口设置不同的选中状态写在了bind()函数内,这样的话,只要一触发onchange,就会重新if else 一遍,就又会根据getQueryString的值选中特定的option。。。

唉,,拿出来就好了。

但是其他浏览器怎么就没受影响呢?

嗯,自己挖的坑要自己填。

select 的选中问题的更多相关文章

  1. 获取select标签选中状态 的label的值。

    <select name="procode" onchange="alert(this.options[this.selectedIndex].text)" ...

  2. js获取select默认选中的Option (非当前选中值)

    js函数方法: <script> function getDefaultSelectedOption(selectId, valIfNull) { var selectId = selec ...

  3. jQuery 设置select默认选中问题

    在进行其他操作后,恢复select默认选中 html代码: <select id="shai" style="width:150px;margin:5px 50px ...

  4. input和textarea标签的select()方法----选中文本框中的所有文本

    JavaScript select()方法选中文本框中的所有文本 <input>和<textarea>两种文本框都支持select()方法,这个方法用于选择文本框中的所有文本 ...

  5. 如何获得select被选中option的value和text

    如何获得select被选中option的value和text 一:JavaScript原生的方法 1:拿到select对象: var myselect=document.getElementById( ...

  6. Vue+Element+Select获取选中的对象

              案例演示:获取select当前选中的所有内容 <el-select v-model="value8" filterable placeholder=&qu ...

  7. JQuery/JS select标签动态设置选中值、设置禁止选择 button按钮禁止点击 select获取选中值

    //**1.设置选中值:(根据索引确定选中值)**// var osel=document.getElementById("selID"); //得到select的ID var o ...

  8. JQuery 获取select被选中的value和text

    html代码: <select name="test" > <option value="0">请选择</option> & ...

  9. 26.如何获得select被选中option的value和text

    如何获得select被选中option的value和text 一:JavaScript原生的方法 1:拿到select对象: var myselect=document.getElementById( ...

  10. 循环获取某个class下的多个select的选中值

    //循环获取某个class下的多个select的选中值 function eachSelect(cla){ var val = ""; $("."+cla).e ...

随机推荐

  1. iOS如何转换十三位的时间戳

    //将十三位的时间戳转换为日期 - (NSString *)getDate:(NSString *)jsonDate { //jsonDate类似这种/Date(1447659630000)/ NSA ...

  2. python读取excel,返回dic列表

    def get_xls_sheets_as_dic(pro_name, xls_name): dic_list = [] xls_path = os.path.join(BASE_PATH, &quo ...

  3. SQL SERVER 死锁

    sp_lock 查看锁表名称 select request_session_id spid,OBJECT_NAME(resource_associated_entity_id) tableNamefr ...

  4. 限时订单实现方案(DelayQueue、ActiveMq)

    原文链接:http://www.studyshare.cn/blog-front/blog/details/1132 一.在各种电商网站下订单后会保留一个时间段,时间段内未支付则自动将订单状态设置为已 ...

  5. java List<Map<String,Object>遍历的方法

    public static void main(String[] args) { List<HashMap<String, Object>> list = new ArrayL ...

  6. 微信小程序自定义组件实现

    官方从 1.6.3 开始对于自定义组件这一块有了比较大的变动,首先比较明显的感觉就是文档比以前全多了,有木有!,现在小程序支持简洁的组件化编程,可以将页面内的功能模块抽象成自定义组件,以便在不同的页面 ...

  7. mysql join优化原理

    http://blog.itpub.net/22664653/viewspace-1692317/ http://itindex.net/detail/46772-%E4%BC%98%E5%8C%96 ...

  8. python中TCP协议中的粘包问题

    TCP协议中的粘包问题 1.粘包现象 基于TCP实现一个简易远程cmd功能 #服务端 import socket import subprocess sever = socket.socket() s ...

  9. Docker Got permission denied while trying to connect to the Docker daemon socket at unix://

    这是没有权限的原因,先将自己加入docker组,然后在重新启动就可以了, 下面参考来源:https://blog.csdn.net/weixin_40896352/article/details/80 ...

  10. 微信小程序 project.config.json 配置

    可以在项目根目录使用 project.config.json 文件对项目进行配置. miniprogramRoot Path String 指定小程序源码的目录(需为相对路径) qcloudRoot ...