Javascript DigitalBush jquery掩码输入类型错误

Javascript DigitalBush jquery掩码输入类型错误,javascript,jquery,typeerror,maskedinput,Javascript,Jquery,Typeerror,Maskedinput,在这件事上,可以说我的头撞到了墙上。我使用的是在这里找到的jquery.maskedinput插件:注意:我更正了第29行的语法错误。这里提到了这个问题:我读到maskedinput.1.3和jquery.1.9可能存在一些兼容性问题,所以我使用了这里提供的迁移:返回旧版本只会产生更多错误。我遇到的问题是firefox抛出了“TypeError:$(…)。掩码不是函数,第21行 test.aspx <%@ Page Language="C#" AutoEventWireup="true"

在这件事上,可以说我的头撞到了墙上。我使用的是在这里找到的jquery.maskedinput插件:注意:我更正了第29行的语法错误。这里提到了这个问题:我读到maskedinput.1.3和jquery.1.9可能存在一些兼容性问题,所以我使用了这里提供的迁移:返回旧版本只会产生更多错误。我遇到的问题是firefox抛出了“TypeError:$(…)。掩码不是函数,第21行

test.aspx

<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="test.aspx.cs"
    Inherits="Test.test" %>
<!DOCTYPE html>
<html>
<head>

<meta name="viewport" content="initial-scale=1.0, user-scalable=no" />
<meta http-equiv="content-type" content="text/html; charset=UTF-8" />
<link type="text/css" rel="stylesheet" href="styles.css" />
<link type="text/css" rel="stylesheet" href="css/jquery-ui-1.8.12.custom.css" />
<link type="text/css" rel="stylesheet" href="http://code.jquery.com/ui/1.10.2/themes/smoothness/jquery-ui.css" />
<script type="text/javascript" src="../Scripts/jquery-1.9.1.js"></script>
<script src="http://code.jquery.com/jquery-migrate-1.2.1.js"></script>
<script type="text/javascript" src="../Scripts/jquery.maskedinput.min.js"></script>

<%-- Begin Phone Validation Script  --%>
<script type="text/javascript">
    $(document).ready(function () {
        //Input Mask for landline phone number
        $("#<%=phone_num1.ClientID%>").mask("(999) 999-9999");
        $("#<%=phone_num2.ClientID%>").mask("(999) 999-9999");
    });
</script>
<%-- End of Phone Validation Script  --%>
</head>
<body onload="initialize()">
<form runat="server">
  <div id="consent-form-container">
        <div class="box">
            <table>
                <tr>
                    <td>
                        <asp:Label ID="Label14" runat="server" Text="Phone 1:"></asp:Label>
                    </td>
                    <td>
                       <asp:TextBox ID="phone_num1" runat="server" CssClass="client_home_ph"></asp:TextBox>
                        <asp:RequiredFieldValidator ID="phone_validation1" runat="server" ControlToValidate="phone_num1" ErrorMessage="*" Font-Bold="True" ForeColor="Red"></asp:RequiredFieldValidator>
                    </td>
                </tr>

                <tr>
                    <td>
                        <asp:Label ID="Label17" runat="server" Text="Phone 2:"></asp:Label>
                    </td>
                    <td>
                        <asp:TextBox ID="phone_num2" runat="server" CssClass="client_home_ph"></asp:TextBox>
                        <asp:RequiredFieldValidator ID="phone_validation2" runat="server" ControlToValidate="phone_num2" ErrorMessage="*" Font-Bold="True" ForeColor="Red"></asp:RequiredFieldValidator>
                    </td>
                </tr>
            </table>
        </div>
   </div>
</form>
</body>
</html>

有趣的是,我几乎一周前就开始工作了,然后我添加了更多的脚本,这就发生了哈哈。非常感谢您的帮助:)

好的,我终于解决了这个问题。下面是我解决这个问题的方法

调试起来很困难,也花了一些时间,但基本上您必须使用较旧版本的jquery,并像这样进行升级

<script src="Scripts/jquery-1.4.4.min.js" type="text/javascript"></script>
<script src="http://code.jquery.com/jquery-1.9.0.js" type="text/javascript"></script>
<script src="http://code.jquery.com/jquery-migrate-1.2.1.js" type="text/javascript></script>


对于任何像我这样更新旧项目的人,我建议花额外的时间和经历所有javascript更新任何不推荐的代码。尽管我解决了这个问题,但几个月后出现了一些其他问题,我不得不这样做。
<script src="Scripts/jquery-1.4.4.min.js" type="text/javascript"></script>
<script src="http://code.jquery.com/jquery-1.9.0.js" type="text/javascript"></script>
<script src="http://code.jquery.com/jquery-migrate-1.2.1.js" type="text/javascript></script>