Wednesday 2 November 2016

jQuery - fix error - 0x800a1391 - JavaScript runtime error: '$' is undefined

Watch this example on YouTube

To fix it Replace

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title></title>
</head>
<body>
    <form id="form1" runat="server">
        <script type="text/javascript">
            $(document).ready(function () {
                $('.rb').click(function () {
                    alert('clicked');
                });
            });
        </script>
    <div>
       
    </div>
    </form>
</body>
</html>



With

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title></title>
    <script type="text/javascript" src="Scripts/jquery-1.10.2.js"></script>
</head>
<body>
    <form id="form1" runat="server">
        <script type="text/javascript">
            $(document).ready(function () {
                $('.rb').click(function () {
                    alert('clicked');
                });
            });
        </script>
    <div>
       
    </div>
    </form>
</body>
</html>

No comments:

Post a Comment