admin管理员组文章数量:1313313
I know this question has been asked probably too many times before but none of those solutions has been able to help me out.I keep getting the above error even if I have everything in place AFAIK.
I have included the button in the html code but when i try to find them through jquery error: "Cannot read property 'ready' of null" occurs moreover it does not even recognize the document.ready function. Here is my full code:
<!DOCTYPE html>
<html xmlns="">
<head>
<title></title>
<script src="Scripts/jquery.js"></script>
<script src="Scripts/jsencrypt.js"></script>
<script src="Scripts/jsencrypt.min.js"></script>
<script src="Scripts/jsencrypt.min.js"></script>
<script src="Scripts/jsencrypt.js"></script>
<script type="text/javascript" src="System.js"></script>
<script type="text/javascript" src="System.IO.js"></script>
<script type="text/javascript" src="System.BigInt.js"></script>
<script type="text/javascript" src="System.BitConverter.js"></script>
<script type="text/javascript" src="System.Convert.js"></script>
<script type="text/javascript" src="System.Security.Cryptography.HMACSHA1.js"></script>
<script type="text/javascript" src="System.Security.Cryptography.js"></script>
<script type="text/javascript" src="System.Security.Cryptography.RSA.js"></script>
<script type="text/javascript" src="System.Security.Cryptography.SHA1.js"></script>
<script type="text/javascript" src="System.Text.js"></script>
<script type="text/javascript">
$(document).ready(function () {
alert("button");
});
// debugger;
// var element = document.getElementById("btntest");
//$("#btntest").click(function () {
// alert("button");
//});
</script>
</head>
<body>
<input type="button" id="btntest" value="Test" />
<span>Name:</span>
<input type="text" id="txtName" />
<br />
<br />
<input type="button" id="btnSend" value="Send" />
</body>
</html>
Any suggestions to resolve this would be really appreciated.
I know this question has been asked probably too many times before but none of those solutions has been able to help me out.I keep getting the above error even if I have everything in place AFAIK.
I have included the button in the html code but when i try to find them through jquery error: "Cannot read property 'ready' of null" occurs moreover it does not even recognize the document.ready function. Here is my full code:
<!DOCTYPE html>
<html xmlns="http://www.w3/1999/xhtml">
<head>
<title></title>
<script src="Scripts/jquery.js"></script>
<script src="Scripts/jsencrypt.js"></script>
<script src="Scripts/jsencrypt.min.js"></script>
<script src="Scripts/jsencrypt.min.js"></script>
<script src="Scripts/jsencrypt.js"></script>
<script type="text/javascript" src="System.js"></script>
<script type="text/javascript" src="System.IO.js"></script>
<script type="text/javascript" src="System.BigInt.js"></script>
<script type="text/javascript" src="System.BitConverter.js"></script>
<script type="text/javascript" src="System.Convert.js"></script>
<script type="text/javascript" src="System.Security.Cryptography.HMACSHA1.js"></script>
<script type="text/javascript" src="System.Security.Cryptography.js"></script>
<script type="text/javascript" src="System.Security.Cryptography.RSA.js"></script>
<script type="text/javascript" src="System.Security.Cryptography.SHA1.js"></script>
<script type="text/javascript" src="System.Text.js"></script>
<script type="text/javascript">
$(document).ready(function () {
alert("button");
});
// debugger;
// var element = document.getElementById("btntest");
//$("#btntest").click(function () {
// alert("button");
//});
</script>
</head>
<body>
<input type="button" id="btntest" value="Test" />
<span>Name:</span>
<input type="text" id="txtName" />
<br />
<br />
<input type="button" id="btnSend" value="Send" />
</body>
</html>
Any suggestions to resolve this would be really appreciated.
Share Improve this question asked Jul 3, 2015 at 8:25 G droidG droid 9666 gold badges14 silver badges38 bronze badges 2-
1
Aside from your issue, why did you include
"Scripts/jsencrypt.min.js"
and"Scripts/jsencrypt.js"
twice? – TaoPR Commented Jul 3, 2015 at 8:29 - @ Tao P. R.: I have removed those now..not using them anymore – G droid Commented Jul 3, 2015 at 9:23
2 Answers
Reset to default 3Have you tried using a CDN for example - https://code.jquery./jquery-1.11.3.min.js
I don't see any problem with the code as long as $ has been overwritten by any other reference below it. If the code does not work with CDN reference, you can also try adding the jquery reference at the end.
It was my bad.Changing the order of the jquery files did the trick. Added the reference of jquery and jquery.min files at the bottom of the other .js files. Might help some one as well.
<script type="text/javascript" src="System.js"></script>
<script type="text/javascript" src="System.IO.js"></script>
<script type="text/javascript" src="System.BigInt.js"></script>
<script type="text/javascript" src="System.BitConverter.js"></script>
<script type="text/javascript" src="System.Convert.js"></script>
<script type="text/javascript" src="System.Security.Cryptography.HMACSHA1.js"></script>
<script type="text/javascript" src="System.Security.Cryptography.js"></script>
<script type="text/javascript" src="System.Security.Cryptography.RSA.js"></script>
<script type="text/javascript" src="System.Security.Cryptography.SHA1.js"></script>
<script type="text/javascript" src="System.Text.js"></script>
<script src="Scripts/jquery.js">
本文标签: javascriptUncaught TypeError Cannot read property 39ready39 of nullStack Overflow
版权声明:本文标题:javascript - Uncaught TypeError: Cannot read property 'ready' of null - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1741873292a2402319.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论