gpt4 book ai didi

jquery - Microsoft JScript 运行时错误 : Object doesn't support property or method 'live' ?

转载 作者:行者123 更新时间:2023-12-03 22:29:17 25 4
gpt4 key购买 nike

我单击按钮时显示以下错误“Microsoft JScript 运行时错误:对象不支持属性或方法“实时”” 我的查看页面如下:

@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最新版本(1.9...),其中$(sel).live(...)已被弃用,因此出现错误消息。

1) 恢复到旧版本的 jquery。

2) 更新您的代码(将 live 替换为 on)。

3)放回jquery-latest。

关于jquery - Microsoft JScript 运行时错误 : Object doesn't support property or method 'live' ?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/14774836/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com