在IIS7上发布后,jQuery无法正常工作 [英] JQuery Not working after publish on IIS7

查看:270
本文介绍了在IIS7上发布后,jQuery无法正常工作的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好

我正在使用ASP.Net,C#和JQuery开发应用程序.我正在使用JQuery与TextBox显示datepicker.它在我的本地系统中正常工作.我已经在本地进行了多次测试,以确保其工作正常.但是,在编译并推送到IIS 7后,它不起作用.以下是我正在使用的代码:

Hi All

I am developing application using ASP.Net, C# and JQuery. I am using JQuery to show datepicker with TextBox. Its working fin in my local system. I have tested so many times in local to ensure its work. But,Its not working after compile and pulish in to IIS 7. Following is the code i am using:

<head runat="server">
    <title></title>
    <script src="Scripts/jquery-1.4.2.js" type="text/javascript"></script>
    <link href="Scripts/jquery-ui.css" rel="stylesheet" type="text/css" />
    <script src="Scripts/jquery-ui.js" type="text/javascript"></script>
    <script type="text/javascript">
        $(function () {

            var date = new Date();
            var currentMonth = date.getMonth();
            var currentDate = date.getDate();
            var currentYear = date.getFullYear();

            $('#txtToDate').datepicker({
                maxDate: new Date(currentYear, currentMonth, currentDate), dateFormat: 'yy-mm-dd'
            });
        });
    </script>
</head>

推荐答案

(function(){ var date = new Date(); var currentMonth = date.getMonth(); var currentDate = date.getDate(); var currentYear = date.getFullYear();
(function () { var date = new Date(); var currentMonth = date.getMonth(); var currentDate = date.getDate(); var currentYear = date.getFullYear();


('#txtToDate').datepicker({ maxDate:新日期(currentYear,currentMonth,currentDate),dateFormat:'yy-mm-dd' }); }); < /script > < /head >
('#txtToDate').datepicker({ maxDate: new Date(currentYear, currentMonth, currentDate), dateFormat: 'yy-mm-dd' }); }); </script> </head>


JQuery只是一组在客户端(而不是服务器)上运行的javascript库.如果在您的本地开发环境上一切正常,则可能是某些相关的javascript脚本未正确发布到您的服务器.确保所有javascript文件都位于网站根目录下的Scripts文件夹中.
JQuery is just a set of javascript libraries that run on the client, not the server. If everything works well on your local development environment, then it is likely that some of the relevant javascript scripts have not been published to your server properly. Ensure that all the javascript files exist in in the Scripts folder under the root of your site.


这篇关于在IIS7上发布后,jQuery无法正常工作的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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