Click here to Skip to main content
15,884,388 members
Please Sign up or sign in to vote.
4.00/5 (1 vote)
See more:
Hai Below is my code , where I have made mistake Please help me...

XML
<script type="text/javascript">
        $(document).ready(function () {
            debugger;
            $('#ctl00$MainContent$btnSave').click(function () {
                $('#MainContent_Success').hide();
                                overlay.appendTo(document.body).remove();
                                return false;
            });
        });

    </script>
Posted
Comments
vbmike 28-Sep-13 10:07am    
Did you include jquery in your file?
Sergey Alexandrovich Kryukov 28-Sep-13 11:55am    
Certainly a correct guess; I explained why in my answer, crediting your comment.
Thank you.
—SA

The code, just the syntax you use, looks correct. This error really indicates that you did not include jQuery file. The assumption by vbmike (please see comments to the question) is correct.


I could look like this:
XML
<html>
<head>
    <title>...</title>
    <script type="text/javascript" src="scripts/jquery-1.10.2.min.js"></script>
</head>
<body>

<!-- your page content goes here, with the JavaScript code like the one you show -->

</body>
</html>


And you need to have the jQuery file itself in appropriate place, or a Web link to it, of one or another version. This is where you can download the latest one: http://jquery.com/download/[^].

—SA
 
Share this answer
 
v5
Comments
Sampath Lokuge 28-Sep-13 11:19am    
+5
Sergey Alexandrovich Kryukov 28-Sep-13 11:52am    
Thank you, Sampath.
—SA
Abhinav S 28-Sep-13 11:41am    
5.
Sergey Alexandrovich Kryukov 28-Sep-13 11:52am    
Thank you, Anhinav.
—SA
Thomas Daniels 28-Sep-13 13:36pm    
Correct, +5
You have to put the reference to the jquery library first is as below.After that put the other references.Order is important here.

<script language="JavaScript" type="text/javascript" src="/js/jquery-1.2.6.min.js"></script>


For more info :

http://stackoverflow.com/questions/2075337/uncaught-referenceerror-is-not-defined[^]

I hope this will help to you.
 
Share this answer
 
Comments
Abhinav S 28-Sep-13 11:41am    
5.
Sampath Lokuge 28-Sep-13 11:47am    
Thanks :)
Thomas Daniels 28-Sep-13 13:36pm    
Correct, +5
Sampath Lokuge 28-Sep-13 14:06pm    
Thanks :)
You can also use @Scripts.Render("~/bundles/jquery) where the path is the path to the file.
 
Share this answer
 
Comments
Sampath Lokuge 28-Sep-13 11:50am    
One problem your solution having is, where we don't know OP is ASP.net developer or not ? He didn't mention it on his tags.
Abhinav S 28-Sep-13 12:06pm    
Fair point. I missed that.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
Top Experts
Last 24hrsThis month


CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900