jQuery   发布时间:2022-03-30  发布网站:大佬教程  code.js-code.com
大佬教程收集整理的这篇文章主要介绍了jquery – Microsoft JScript运行时错误:对象不支持属性或方法’live’?大佬教程大佬觉得挺不错的,现在分享给大家,也给大家做个参考。
我点击按钮显示以下错误“MIcrosoft JScript运行时错误:对象不支持属性方法’live’”
我的查看页面如下:
@model Charis.Models.Products
@{
    ViewBag.title = "Create";
    Layout = "~/Views/Shared/_Layout.cshtml";
}
<link href="../../Content/CharisSite.css" rel="stylesheet" type="text/css" />
<script type="text/javascript" src="http://code.jquery.com/jquery-latest.js"></script>
@using (Html.beginForm("Create","Prod",FormMethod.Post,new { enctype = "multipart/form-data" }))
{
    @Html.ValidationSumMary(true)
    <table><tr><td>
    <table>
    <tr>
    <td>
     <fieldset>
             <legend>Products</legend>

     <table>
        <tr>
        <td>
            <div class="editor-label">
            @Html.LabelFor(model => model.ProductName)
            </div>
        </td>
        <td>
             <div class="editor-field">
            @Html.EditorFor(model => model.ProductName)
            @Html.ValidationmessageFor(model => model.ProductName)
            </div>
        </td>
        </tr>
        <tr>
        <td>
            <div class="editor-label">
                @Html.LabelFor(model => model.ProductPricE)
            </div>
        </td>
        <td>
            <div class="editor-field">
            @Html.EditorFor(model => model.ProductPricE)
            @Html.ValidationmessageFor(model => model.ProductPricE)
            </div>
        </td>
        </tr>
        <tr>
        <td>
            <div class="editor-label">
            @Html.LabelFor(model => model.ProductDiscount)
            </div>
        </td>
        <td>
            <div class="editor-field">
            @Html.EditorFor(model => model.ProductDiscount)
            @Html.ValidationmessageFor(model => model.ProductDiscount)
            </div>
        </td>
        </tr>

        <tr>
        <td>
            <div class="editor-label">
                @Html.LabelFor(model => model.LanguageTypE)
            </div>
        </td>
        <td>
             <div class="editor-field">
            @Html.EditorFor(model => model.LanguageTypE)
            @Html.ValidationmessageFor(model => model.LanguageTypE)
            </div>
        </td>
        </tr>

        <tr>
        <td>
             <div class="editor-label">
                @Html.LabelFor(model => model.ReleaseDatE)
            </div>
        </td>
        <td>
                <div class="editor-field">
                         @Html.EditorFor(model => model.ReleaseDatE)
                         @Html.ValidationmessageFor(model => model.ReleaseDatE)
                </div>
        </td>
        </tr>
        <tr>
        <td>
             <div class="editor-label">

               <label for="file">Upload Image:</label>
            </div>
        </td>
        <td>
                <div class="editor-field">
                    <input type="file" name="file" id="file"/>
               </div>
        </td>
        </tr>

     </table> 

    </fieldset>
    </td>
    <td></td></tr>
    </table>

    </td></tr>
    <tr><td>



    <table>
    <tr>
    <td>
        <fieldset>
        <legend>Details</legend>
            <table>
                <tr>
                    <td>
                        <div class="editor-label">
                            @Html.LabelFor(model => model.AlbumDescription1)
                        </div>
                    </td>
                    <td>
                        <div class="editor-field">
                            @Html.EditorFor(model => model.AlbumDescription1)
                            @Html.ValidationmessageFor(model => model.AlbumDescription1)
                        </div>
                    </td>
                </tr>
                <tr>
                    <td>
                        <div class="editor-label">
                            @Html.LabelFor(model => model.AlbumDescription2)
                        </div>
                    </td>
                    <td>
                        <div class="editor-field">
                            @Html.EditorFor(model => model.AlbumDescription2)
                            @Html.ValidationmessageFor(model => model.AlbumDescription2)
                        </div>
                    </td>
                </tr>
                <tr>
                    <td>
                        <div class="editor-label">
                            @Html.LabelFor(model => model.Cast)
                        </div>
                    </td>
                    <td>
                        <div class="editor-field">
                            @Html.EditorFor(model => model.Cast)
                            @Html.ValidationmessageFor(model => model.Cast)
                        </div>
                    </td>
                </tr>
                <tr>
                    <td>
                        <div class="editor-label">
                            @Html.LabelFor(model => model.DirectedBy)
                        </div>
                    </td>
                    <td>
                        <div class="editor-field">
                            @Html.EditorFor(model => model.DirectedBy)
                            @Html.ValidationmessageFor(model => model.DirectedBy)
                        </div>
                    </td>
                </tr>
                <tr>
                    <td>
                        <div class="editor-label">
                            @Html.LabelFor(model => model.ProducedBy)
                        </div>
                    </td>
                    <td>
                        <div class="editor-field">
                            @Html.EditorFor(model => model.ProducedBy)
                            @Html.ValidationmessageFor(model => model.ProducedBy)
                        </div>
                    </td>
                </tr>

                <tr>
                    <td>
                        <div class="editor-label">
                           <label for="file">Upload Image1:</label>
                        </div>
                    </td>
                    <td>
                        <div class="editor-field">
                            <input type="file" name="file1" id="file1"/>
                        </div>
                    </td>
                </tr>

                <tr>
                    <td>
                        <div class="editor-label">
                           <label for="file">Upload Image2:</label>
                        </div>
                    </td>
                    <td>
                        <div class="editor-field">
                            <input type="file" name="file2" id="file2"/>
                        </div>
                    </td>
                </tr>

                <tr>
                    <td>
                        <div class="editor-label">
                           <label for="file">Upload Image3:</label>
                        </div>
                    </td>
                    <td>
                        <div class="editor-field">
                            <input type="file" name="file3" id="file3"/>
                        </div>
                    </td>
                </tr>

                <tr>
                    <td>
                        <div class="editor-label">
                           <label for="file">Upload Image4:</label>
                        </div>
                    </td>
                    <td>
                        <div class="editor-field">
                            <input type="file" name="file4" id="file4"/>
                        </div>
                    </td>
                </tr>

                <tr>
                    <td>
                        <div class="editor-label">
                           <label for="file">Upload Image5:</label>
                        </div>
                    </td>
                    <td>
                        <div class="editor-field">
                            <input type="file" name="file5" id="file5"/>
                        </div>
                    </td>
                </tr>

                <tr>
                    <td>
                        <div class="editor-label">
                            @Html.LabelFor(model => model.NoOfDisk)
                        </div>
                    </td>
                    <td>
                        <div class="editor-field">
                            @Html.EditorFor(model => model.NoOfDisk)
                            @Html.ValidationmessageFor(model => model.NoOfDisk)
                        </div>
                    </td>
                </tr>

                <tr>
                    <td>
                        <div class="editor-label">
                            @Html.LabelFor(model => model.Weight)
                        </div>
                    </td>
                    <td>
                        <div class="editor-field">
                            @Html.EditorFor(model => model.Weight)
                            @Html.ValidationmessageFor(model => model.Weight)
                        </div>
                    </td>
                </tr>

                <tr>
                    <td>
                        <div class="editor-label">
                            @Html.LabelFor(model => model.Format)
                        </div>
                    </td>
                    <td>
                        <div class="editor-field">
                            @Html.EditorFor(model => model.Format)
                            @Html.ValidationmessageFor(model => model.Format)
                        </div>
                    </td>
                </tr>

            </table>
        </fieldset>
    </td>
    </tr>
    </table>



    </td></tr>

    <tr><td>
        <table><tr><td><fieldset><table>
            <tr>
                <td>
                <p>
                    <input type="submit" value="Create" />
                    <input type="button" value="Clear" id="btnClear" />
                </p>
                </td>
            </tr>
        </table></fieldset></td></tr></table>

    </td></tr>

    </table>

}

@*<div>
    @Html.ActionLink("BACk to List","Index")
</div>
*@
@section Scripts {
    @Scripts.Render("~/bundles/jqueryval")
}

@if (TemPDAta["notice"] != null) 
{
<p style="color:red;" >@TemPDAta["notice"]</p>
}

解决方法

你正在使用jquery latest(1.9 …),其中$(sel).live(…)被弃用,因此你的错误信息.

1)恢复到旧版本的jquery.

2)更新你的代码(用live替换).

3)放回jquery-latest.

大佬总结

以上是大佬教程为你收集整理的jquery – Microsoft JScript运行时错误:对象不支持属性或方法’live’?全部内容,希望文章能够帮你解决jquery – Microsoft JScript运行时错误:对象不支持属性或方法’live’?所遇到的程序开发问题。

如果觉得大佬教程网站内容还不错,欢迎将大佬教程推荐给程序员好友。

本图文内容来源于网友网络收集整理提供,作为学习参考使用,版权属于原作者。
如您有任何意见或建议可联系处理。小编QQ:384754419,请注明来意。