简体   繁体   English

在Select2中出现无法读取未定义的属性'createTextRange'

[英]In Select2 appears Cannot read property 'createTextRange' of undefined

I have a select with some data.. normal data, nothing fancy and i'm using select2 to format this data like this: 我有一些数据选择。普通数据,没什么花哨的,我正在使用select2格式化这样的数据:

<select class="select2-option" id="propertySet_PropertyValues_89d25cf7-fdff-4cf9-8bd6-144e05e38d3e__Value" name="propertySet.PropertyValues[89d25cf7-fdff-4cf9-8bd6-144e05e38d3e].Value" style="width: 250px" tabindex="-1" title="waist">
<option value=""></option>
<option value="84">new born</option>
<option value="85">xs</option>
<option value="86">s</option>
<option value="87">m</option>
<option value="88">l</option>
<option value="89">xl</option>
<option value="103">3 months</option>
<option value="104">6 months</option>
<option value="105">9 months</option>
<option value="106">12 months</option>
<option value="134">xxl</option>
<option value="135">child 6</option>
<option value="136">child 8</option>
<option value="137">child 10</option>
<option value="138">child 12</option>
<option value="139">child 14</option>
</select>

and the javascript: 和javascript:

function loadSelect2()
{
    $('.select2-option').select2();
}

I'm getting the message: 我收到消息:

Cannot read property 'createTextRange' of undefined 无法读取未定义的属性“ createTextRange”

when I click on the select2 combo. 当我单击select2组合时。

尝试在选择器中不要包含破折号(-)。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 select2:无法读取未定义的属性“id” - select2: cannot read property 'id' of undefined Select2 Uncaught TypeError:无法读取未定义的属性“调用” - Select2 Uncaught TypeError: Cannot read property 'call' of undefined select2 ajax:未捕获的TypeError:无法读取未定义的属性“上下文” - select2 ajax : Uncaught TypeError: Cannot read property 'context' of undefined 无法使用select2读取jQuery验证上未定义的nodeName属性 - Cannot read property of nodeName undefined on jQuery validation with select2 select2 : 无法读取 null 的属性查询 - select2 : cannot read property query of null 使用select2无法读取null的属性“查询” - Cannot read property 'query' of null with select2 Select2自定义搜索回调中的“ Uncaught TypeError:无法读取未定义的属性&#39;disabled&#39;” - “Uncaught TypeError: Cannot read property 'disabled' of undefined” in Select2 Custom Search callback 未捕获的TypeError:无法读取null的属性“ getAttribute”(Select2下拉列表) - Uncaught TypeError: Cannot read property 'getAttribute' of null (Select2 dropdown) 未捕获的TypeError:无法读取select2中null的属性“ replace” - Uncaught TypeError: Cannot read property 'replace' of null in select2 无法读取未定义的属性“ then” - Cannot read property 'then' of undefined
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM