我在我的网站上遇到问题其中一个页面无法处理ie7和ie8但正在使用其他浏览器,返回此错误 "意外调用方法或属性访问" 即时通讯使用jquery-1.8.3 这是我的代码: 我的看法......
@model SmartTimers.Models.AccountEdit
@{
ViewBag.Title = "AccountEdit";
string userName = ViewBag.userName;
//Guid userId = ViewBag.userId;
int buttonid1 = 1;
int buttonid2 = 2;
var buttonId = ViewBag.buttonId;
}
<div id="page-content">
<div class="container">
<h2>
Account Settings</h2>
User Name: @Membership.GetUser()
<div>
<div id="accordion">
<input type="submit" value="Edit User Name"
class = "btn btn-default" id="open-profile-Username" />
<div style="padding: 0 30px 0 30px">
<h2>
Edit User Name</h2>
<p>
Use the form below to change your User Name.
</p>
<p>
Your Email Address will be use as your User Name also.
</p>
@using (Html.BeginForm("AccountEdit", "Account", FormMethod.Post, new { buttonid = buttonid1, id="editUserName" }))
{
if (buttonId == 1)
{
@Html.ValidationSummary(true, "User Name change was unsuccessful. Please correct the errors and try again.")
}
<input type="hidden" id="buttonid" name="buttonid" value="@buttonid1" />
<div>
<fieldset>
<legend>User Name Edit</legend>
<div class="editor-label">
@Html.LabelFor(m => m.UserName)
</div>
<div class="editor-field">
@userName
</div>
<div class="editor-label">
@Html.LabelFor(m => m.NewUserName)
</div>
<div class="editor-field">
<input type="text" id="email" name="Email" class="validate[required,custom[email]] inputLong"
value="" />
</div>
<p>
<input type="submit" value="Update User Name / Email Address" class="userNameChange btn btn-default" />
<a class="close-profile-Username" href="">Cancel</a>
</p>
</fieldset>
</div>
}
</div>
<input type="submit" value="Change Password" class ="btn btn-default"
id="open-profile-Password" />
<div style="padding: 0 30px 0 30px">
<h2>
Change Password</h2>
<p>
Use the form below to change your password.
</p>
<p>
New passwords are required to be a minimum of @Membership.MinRequiredPasswordLength
characters in length.
</p>
@using (Html.BeginForm("AccountEdit", "Account", new { buttonid = buttonid2 }, FormMethod.Post, new { id = "passwordChangeForm" }))
{
if (buttonId == 2)
{
@Html.ValidationSummary(true, "Password change was unsuccessful. Please correct the errors and try again.")
}
<input type="hidden" id="buttonid" name="buttonid" value="@buttonid2" />
<div>
<fieldset>
<legend>Account Information</legend>
<div class="editor-label">
@Html.LabelFor(m => m.OldPassword)
</div>
<div class="editor-field">
@Html.PasswordFor(m => m.OldPassword)
@Html.ValidationMessageFor(m => m.OldPassword)
</div>
<div class="editor-label">
@Html.LabelFor(m => m.NewPassword)
</div>
<div class="editor-field">
@Html.PasswordFor(m => m.NewPassword)
@Html.ValidationMessageFor(m => m.NewPassword)
</div>
<div class="editor-label">
@Html.LabelFor(m => m.ConfirmPassword)
</div>
<div class="editor-field">
@Html.PasswordFor(m => m.ConfirmPassword)
@Html.ValidationMessageFor(m => m.ConfirmPassword)
</div>
<p>
<input type="submit" value="Change Password" class="btn btn-default" />
<a class="close-profile-Password" id="cancelBtn" href="">Cancel</a>
</p>
</fieldset>
</div>
}
</div>
</div>
@if (User.IsInRole("Administrator"))
{
<div style="clear: both; padding: 20px 0 10px 0">
@Html.ActionLink("Cancel", "ClientDetails", "Client", null, new { @class = "btn btn-default" })
</div>
}
else if (User.IsInRole("Employer"))
{
<div style="clear: both; padding: 20px 0 10px 0">
@Html.ActionLink("Cancel", "CustomerIndex", "Customer", null, new { @class = "btn btn-default" })
</div>
}
else
{
<div style="clear: both; padding: 20px 0 10px 0">
@Html.ActionLink("Cancel", "WorkerIndex", "Worker", null, new { @class = "btn btn-default" })
</div>
}
</div>
</div>
</div>
这是我的js:
<script type="text/javascript">
$(function () {
$("#accordion").accordion({
heightStyle: "content",
collapsible: true,
active: false,
autoHeight: false,
animated: false
});
$("#editUserName").validationEngine();
var buttonid = $("#buttonid");
$("#changeUserForm").validationEngine();
$("#open-profile-Username").click(function (e) {
$('#open-profile-Username').attr("hidden", true);
$('#open-profile-Password').attr("hidden", false);
$('#editUserName').validationEngine('hide');
});
$("#open-profile-Password").click(function (e) {
$('#NewPassword').attr("value", "");
$('#OldPassword').attr("value", "");
$('#ConfirmPassword').attr("value", "");
$('#changeUserForm').validationEngine('hide');
$('#open-profile-Password').attr("hidden", true);
$('#open-profile-Username').attr("hidden", false);
});
});
</script>
这是我的布局文件:
<!DOCTYPE html>
<!--[if lt IE 7]> <html class="no-js lt-ie9 lt-ie8 lt-ie7"> <![endif]-->
<!--[if IE 7]> <html class="no-js lt-ie9 lt-ie8"> <![endif]-->
<!--[if IE 8]> <html class="no-js lt-ie9"> <![endif]-->
<!--[if gt IE 8]><!-->
<html class="no-js">
<!--<![endif]-->
<head>
<meta charset="utf-8" />
<meta http-equiv="X-UA-Compatible" content="IE=7" />
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" />
<title>@ViewBag.Title</title>
<meta name="description" content="" />
<meta name="viewport" content="width=device-width" />
<!-- Place favicon.ico and apple-touch-icon.png in the root directory -->
<link rel="stylesheet" href="@Url.Content("~/Content/normalize.css")" />
<link href="@Url.Content("~/Content/kendo.common.min.css")" rel="stylesheet" type="text/css" />
<link href="@Url.Content("~/Content/kendo.metro.min.css")" rel="stylesheet" type="text/css" />
<link href="@Url.Content("~/Content/validationEngine.jquery.css")" rel="stylesheet" type="text/css" />
@*<link href="../../Content/Site.css" rel="stylesheet" type="text/css" />*@
<link href="@Url.Content("~/Content/colorbox.css")" rel="stylesheet" type="text/css" />
<script src="@Url.Content("~/Scripts/jquery-1.8.3.min.js")" type="text/javascript"></script>
<script src="@Url.Content("~/Scripts/kendo.all.min.js")" type="text/javascript"></script>
<script src="@Url.Content("~/Scripts/modernizr-2.6.2.min.js")" type="text/javascript"></script>
<script src="@Url.Content("~/Scripts/jquery.validate.min.js")" type="text/javascript"></script>
<script src="@Url.Content("~/Scripts/jquery.validate.unobtrusive.min.js")" type="text/javascript"></script>
<script src="@Url.Content("~/Scripts/jquery-ui.js")" type="text/javascript"></script>
<link href='http://fonts.googleapis.com/css?family=Lato:400,700,400italic,700italic|Roboto+Condensed:400,700'
rel='stylesheet' type='text/css' />
<script src="@Url.Content("~/Scripts/jquery.validationEngine.js")" type="text/javascript"></script>
<script src="@Url.Content("~/Scripts/jquery.validationEngine-en.js")" type="text/javascript"></script>
<script src="@Url.Content("~/Scripts/jquery.colorbox.js")" type="text/javascript"></script>
<script src="@Url.Content("https://maps.googleapis.com/maps/api/js?v=3.14&key=AIzaSyD_b-Iyp4MpC2fvDSgtFVPyznZJCxIeUNw&sensor=false")" type="text/javascript"></script>
<link href="../../Content/css/bootstrap.css" rel="stylesheet" type="text/css" />
<link href="../../Content/css/flexslider.css" rel="stylesheet" type="text/css" />
<link href="../../Content/css/style.css" rel="stylesheet" type="text/css" />
<link href="../../Content/css/responsive.css" rel="stylesheet" type="text/css" />
</head>
那里..我使用asp.net mvc ..谢谢......