无法解决错误,即“jQuery”未定义 [英] unable to resolve error i.e 'jQuery' is undefined

查看:62
本文介绍了无法解决错误,即“jQuery”未定义的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

嗨朋友

当我在浏览器中查看它时,我发现了一段代码'jQuery'是未定义的错误。



在这段代码中我想要实现datepicker但是我无法这样做

我已经参考了许多网站,而且我发现了类似的代码写的

请帮我找出我错的地方

 <   asp:Content     ID   =  Content1    ContentPlaceHolderID   =  ContentPlaceHolder1    Runat   = 服务器 >  

< script src = jscript / jquery.datePicker.js type = text / javascript > < / script >

< span class =code-keyword>< script src = jscript / jquery-1.5.1.min.js type = < span class =code-keyword> text / javascript > < < span class =code-leadattribute> / script >

< ; script type < span class =code-keyword> = text / javascript >
$(function(){
$('#startdate')。datepicker({dateFormat:'dd / mm / yyyy'});
$('#enddate')。datepicker({dateFormat:'dd / mm / yyyy'});
});
< / script >


< div id = content > 来自< asp :TextBox ID = startdate class = 字段 runat = server > < / asp:TextBox > -
< asp:TextBox ID = enddate class = field runat = 服务器 > < / asp:TextBox > < / div >
< / asp:Content >





我正在使用母版页

其中我是包括这里使用的以下两个参考



 <  < span class =code-leadattribute> link     href   =  jscript / jquery.ui.all.css    rel   =  stylesheet    type   =  text / css    /  >  
< link < span class =code-attribute> href = jscript / datePicker.css rel = stylesheet type = text / css / >



我已经检查了其他功能的脚本是否适用于例如$(' #startdate')。value(some text)工作得很好

但是datepicker方法不起作用

它也给出错误这个方法不是由对象支持



提前致谢....

解决方案

(function(){


('#startdate')。datepicker({dateFormat:'dd / mm / yyyy'});


('#enddate')。datepicker({dateFormat:'dd / mm / yyyy'});
});
< / script >


< div id = content > 来自< asp :TextBox ID = startdate class = 字段 runat = server > < / asp:TextBox > -
< asp:TextBox ID = enddate class = field runat = 服务器 > < / asp:TextBox > < / div >
< / asp:Content >





我正在使用母版页

其中我是包括这里使用的以下两个参考



 <  < span class =code-leadattribute> link     href   =  jscript / jquery.ui.all.css    rel   =  stylesheet    type   =  text / css    /  >  
< link < span class =code-attribute> href = jscript / datePicker.css rel = stylesheet type = text / css / >



我已经检查了其他函数的脚本是否适用于例如


hi friends
i've a piece of code when i view it in browser it gives 'jQuery' is undefined error.

In this code i Want datepicker to be implemented however i'm not able to do so
I've reffered many sites and i'm finding similar kind of code written
please help me out to find out where i'm wrong

<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">

    <script src="jscript/jquery.datePicker.js" type="text/javascript"></script>

    <script src="jscript/jquery-1.5.1.min.js" type="text/javascript"></script>

     <script type="text/javascript">
        $(function() {
           $('#startdate').datepicker({ dateFormat: 'dd/mm/yyyy' });
           $('#enddate').datepicker({ dateFormat: 'dd/mm/yyyy' });
          });
    </script>


<div id="content">        From <asp:TextBox ID="startdate" class="field" runat="server"></asp:TextBox> -
 To <asp:TextBox ID="enddate" class="field" runat="server"></asp:TextBox>    </div>
</asp:Content>



i'm using master page
in which i've included these two following references that are used here

<link href="jscript/jquery.ui.all.css" rel="stylesheet" type="text/css" />
   <link href="jscript/datePicker.css" rel="stylesheet" type="text/css" />


i've checked the script with other functions is working for eg $('#startdate').value("some text") works very well
but datepicker method is not working
it is also giving error that this method is not supported by object

Thanks in advance....

解决方案

(function() {


('#startdate').datepicker({ dateFormat: 'dd/mm/yyyy' });


('#enddate').datepicker({ dateFormat: 'dd/mm/yyyy' }); }); </script> <div id="content"> From <asp:TextBox ID="startdate" class="field" runat="server"></asp:TextBox> - To <asp:TextBox ID="enddate" class="field" runat="server"></asp:TextBox> </div> </asp:Content>



i'm using master page
in which i've included these two following references that are used here

<link href="jscript/jquery.ui.all.css" rel="stylesheet" type="text/css" />
   <link href="jscript/datePicker.css" rel="stylesheet" type="text/css" />


i've checked the script with other functions is working for eg


这篇关于无法解决错误,即“jQuery”未定义的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆