【发布时间】:2022-05-14 15:00:45
【问题描述】:
我正在尝试在 Asp.net core 6.0 razor 页面中使用 intl-tel-input 这是我的脚本
$(document).ready(function(){
$('#tbxPhone').intlTelInput();
});
但是报错
控制台错误;
intlTelInput.js:10 Uncaught SyntaxError: Invalid regular expression: /^[a-zA-ZÀ-ÿ ]$/: Range out of order in character class
jquery-3.1.1.min.js:2 jQuery.Deferred exception: $(...).intlTelInput is not a function TypeError: $(...).intlTelInput is not a function
at HTMLDocument.<anonymous> (https://localhost:7283/SignUp:99:28)
at j (https://localhost:7283/assets/js/jquery-3.1.1.min.js:2:29948)
at k (https://localhost:7283/assets/js/jquery-3.1.1.min.js:2:30262) undefined
Uncaught TypeError: $(...).intlTelInput is not a function
at HTMLDocument.<anonymous> (SignUp:99:28)
at j (jquery-3.1.1.min.js:2:29948)
at k (jquery-3.1.1.min.js:2:30262)
【问题讨论】:
-
您的
^[a-zA-ZÀ-ÿ ]$中似乎有多余的空间。而您的jquery 3.1.1与您的intlTelInput.js不兼容。 -
显示整个 Html 代码以及 js 声明。
标签: c# asp.net-core .net-core