在MVC5项目中添加jQuery代码赢得';不要加载新代码

在MVC5项目中添加jQuery代码赢得';不要加载新代码,jquery,asp.net-mvc-5,Jquery,Asp.net Mvc 5,我在一个MVC5项目中有一个js脚本中的简单代码 $(document).ready(function () { $(function () { $("#datepicker").datepicker(); }); }); 我尝试添加代码,但新代码没有加载到浏览器中,是否涉及一些缓存,或者浏览器如何只记住旧文件。 需要提到的是,我清除了所有cookie、浏览器缓存、清理、构建和重建VS中的解决方案,但我认为问题出在其他地方 使

我在一个MVC5项目中有一个js脚本中的简单代码

  $(document).ready(function () {
        $(function () {
            $("#datepicker").datepicker();
        });
    });
我尝试添加代码,但新代码没有加载到浏览器中,是否涉及一些缓存,或者浏览器如何只记住旧文件。 需要提到的是,我清除了所有cookie、浏览器缓存、清理、构建和重建VS中的解决方案,但我认为问题出在其他地方

使用JS和CSS查看

<div class="form-horizontal">
    <h4>ProgramareMF</h4>
    <hr />
    <div class="form-group">

        @Html.LabelFor(model => model.DataProgramare, htmlAttributes: new { @class = "control-label col-md-2" })
        <div class="col-md-10">
            @Html.EditorFor(model => model.DataProgramare, new { htmlAttributes = new { @class = "form-control", @placeholder="Alege Data Programare", @id = "datepicker" } })
            @Html.ValidationMessageFor(model => model.DataProgramare, "", new { @class = "text-danger" })

        </div>
        <div class="example">
            <select data-bind="options: hourOptions, optionsText: formatTimeOption, value: startDateHour"></select>
            <select data-bind="options: minuteOptions, optionsText: formatTimeOption, value: startDateMinute"></select>
        </div>
    </div>

    <div class="form-group">
        @Html.LabelFor(model => model.PacientNume, htmlAttributes: new { @class = "control-label col-md-2"})
        <div class="col-md-10">
            @Html.EditorFor(model => model.PacientNume, new { htmlAttributes = new { @class = "form-control", @placeholder = "Nume" } })
            @Html.ValidationMessageFor(model => model.PacientNume, "", new { @class = "text-danger" })
        </div>
    </div>

    <div class="form-group">
        @Html.LabelFor(model => model.PacientEmail, htmlAttributes: new { @class = "control-label col-md-2" })
        <div class="col-md-10">
            @Html.EditorFor(model => model.PacientEmail, new { htmlAttributes = new { @class = "form-control", @placeholder = "Email" } })
            @Html.ValidationMessageFor(model => model.PacientEmail, "", new { @class = "text-danger" })
        </div>
    </div>

    <div class="form-group">
        <div class="col-md-offset-2 col-md-10">
            <input type="submit" value="Create" class="btn btn-default" />
        </div>
    </div>
</div>

程序性EMF

@LabelFor(model=>model.dataprogrammare,htmlAttributes:new{@class=“controllabel col-md-2”}) @EditorFor(model=>model.dataprogrammare,new{htmlAttributes=new{@class=“form control”,@placeholder=“Alege Data programmare”,@id=“datepicker”}) @Html.ValidationMessageFor(model=>model.DataProgramare,“,new{@class=“text danger”}) @LabelFor(model=>model.PacientNume,htmlAttributes:new{@class=“controllabel col-md-2”}) @EditorFor(model=>model.PacientNume,new{htmlAttributes=new{@class=“form control”,@placeholder=“Nume”}) @Html.ValidationMessageFor(model=>model.PacientNume,“,new{@class=“text danger”}) @LabelFor(model=>model.pacientmail,htmlAttributes:new{@class=“controllabel col-md-2”}) @EditorFor(model=>model.pacientmail,new{htmlAttributes=new{@class=“form control”,@placeholder=“Email”}) @Html.ValidationMessageFor(model=>model.PacientEmail,“,new{@class=“text danger”})
hmm,没有,还是什么都没有…现在这样做了,但过去这样做没有任何效果,现在我看到我在firefox上打开了一个项目会话,现在使用chrome,关闭加载了添加的jQuery的会话。。谢谢你的回答为什么你有一个现成的处理器在一个现成的处理器里面<代码>$(文档).ready()和
$(函数(){})
在功能上是相同的。我添加了更多的代码,所以我在$(函数(){})中添加了datepicker以提高可读性,我想我从来没有在Chrome中进行过快速测试,因为它会长期缓存大量的东西。比如脚本文件、css,甚至有时候还有身份验证。我使用IE进行测试,因为它是浏览器中最小的公分母。我将其设置为每次退出时删除所有内容,因此每次重新启动调试会话时,浏览器都会退出并获取所有新文件。这使得查看更改变得更加容易,尤其是在脚本文件和css中。IE更好地集成到VisualStudio中。