【问题标题】:jQuery UI Chosen MultiSelect plugin selection retained in Chrome but not IE11 or EdgejQuery UI Chosen MultiSelect 插件选择保留在 Chrome 中,但不是 IE11 或 Edge
【发布时间】:2018-09-25 13:00:37
【问题描述】:

我有一个与the next one直接相反的问题:

我正在使用 jQuery ChosenMultiSelect 插件。当使用IE 11Microsoft Edge时,如果我从下拉列表中选择3个选项,浏览到另一个页面然后按浏览器返回按钮,这些值不会保留在textarea中。

在 Chrome 中,如果我做同样的事情,值会被保留。

【问题讨论】:

    标签: jquery jquery-ui jquery-chosen


    【解决方案1】:

    我通过window.history.pushState (null, null, url); 在 URL 中设置参数来完成这项工作。

    来自this answer的函数:

    function parameterizeArray(key, arr) {
        if (!arr) {
            return "";
        }
        arr = arr.map(encodeURIComponent);
        return '?' + key + '=' + arr.join('&' + key + '=');
    }
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2021-09-14
      相关资源
      最近更新 更多