File tree Expand file tree Collapse file tree 3 files changed +12
-12
lines changed
Expand file tree Collapse file tree 3 files changed +12
-12
lines changed Original file line number Diff line number Diff line change @@ -12,8 +12,8 @@ cxSelect 是基于 jQuery 的多级联动菜单插件,适用于省市、商品
1212
1313** 版本:**
1414
15- * jQuery v1.7+
16- * jQuery cxSelect v1.3.8
15+ * jQuery v1.7+ | Zepto v1.0+
16+ * jQuery cxSelect v1.3.9
1717
1818文档:http://code.ciaoca.com/jquery/cxselect/
1919
@@ -95,7 +95,7 @@ $.cxSelect.defaults.nodata = 'none';
9595 <tr >
9696 <td>required</td>
9797 <td>false</td>
98- <td>是否为必选。设为 flase 时,会在列表头部添加 `<option value="firstValue">firstTitle</option>` 选项。</td>
98+ <td>是否为必选。设为 false 时,会在列表头部添加 `<option value="firstValue">firstTitle</option>` 选项。</td>
9999 </tr >
100100 <tr >
101101 <td>firstTitle</td>
Original file line number Diff line number Diff line change 11/*!
22 * jQuery cxSelect
33 * @name jquery.cxselect.js
4- * @version 1.3.8
5- * @date 2015-12-7
4+ * @version 1.3.9
5+ * @date 2016-01-06
66 * @author ciaoca
77 * @email ciaoca@gmail.com
88 * @site https://github.com/ciaoca/cxSelect
8383 if ( ! _tempSelect ) { break } ;
8484
8585 // 保存默认值
86- if ( typeof _tempSelect . val ( ) === 'string' ) {
87- _tempSelect . data ( ' value', _tempSelect . val ( ) ) ;
86+ if ( typeof _tempSelect . val ( ) === 'string' && _tempSelect . val ( ) . length ) {
87+ _tempSelect . attr ( 'data- value', _tempSelect . val ( ) ) ;
8888 } ;
8989
9090 self . selectArray . push ( _tempSelect ) ;
102102 self . start ( ) ;
103103
104104 // 设置 URL,通过 Ajax 获取数据
105- } else if ( typeof self . settings . url === 'string' ) {
105+ } else if ( typeof self . settings . url === 'string' && self . settings . url . length ) {
106106 $ . getJSON ( self . settings . url , function ( json ) {
107107 self . start ( json ) ;
108108 } ) ;
284284
285285 // 初次加载设置默认值
286286 if ( typeof select . data ( 'value' ) !== 'undefined' ) {
287- select . val ( String ( select . data ( 'value' ) ) ) . removeData ( 'value' ) . removeAttr ( 'data-value' ) ;
287+ select . val ( String ( select . data ( 'value' ) ) ) . removeAttr ( 'data-value' ) ;
288288 } ;
289289
290290 select . trigger ( 'change' ) ;
You can’t perform that action at this time.
0 commit comments