I have jquery issue when using $ .noConflict

Hi, I need to use the noConflict method in my project. But I have a problem. If I do not use this method, the project works correctly. But if I use this method, I have an error. How can I solve this problem.

<html xmlns="http://www.w3.org/1999/xhtml"> <head runat="server"> <title></title> <script type='text/javascript' src="javascripts/jquery.min.js"></script> <script type="text/javascript"> $.noConflict(); // İf I dont use this method, project is working correctly. // But if I use this method, I have a error </script> <script language="javascript" type="text/javascript"> function goster() { alert($("#TextBox1").val()); } </script> </head> <body> <form id="form1" runat="server"> <asp:TextBox ID="TextBox1" onBlur="goster();" runat="server"></asp:TextBox> </form> </body> </html> 
0
jquery
source share
1 answer

If you use $.noConflict(); you should use jQuery instead of $ .

 <script language="javascript" type="text/javascript"> function goster() { alert(jQuery("#TextBox1").val()); } </script> 

see demo. http://jsfiddle.net/UnUgP/3/

+1
source share

All Articles