在 IE8 中使用 window.location 时出现 Microsoft JScript 运行时错误
我的代码中有一个奇怪的错误。 我收到错误: Microsoft JScript 运行时错误:对象不支持此操作。 我正在使用 fullcalendar,并在事件中单击“我想在同一窗口中打开甚至详细信息”。奇怪的是,这在 Chrome 中运行良好。我还想指出的是,在 XP 系统上,它在 IE8 和 Chrome 中都可以正常工作,而在 Windows 7 中,chrome 可以正常工作,而 IE8 会出现错误。
这是一个屏幕截图:
这是我的查看代码:
<%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/HomePagesMaster.Master" Inherits="System.Web.Mvc.ViewPage<Perspectiva.Models.EventViewModel>" %>
<asp:Content ID="Content1" ContentPlaceHolderID="TitleContent" runat="server">
פרספקטיבה - לוח ארועים
</asp:Content>
<asp:Content ID="mainContent" ContentPlaceHolderID="PageContent" runat="server">
<!-- jquery scripts needed for for the calendar and datepicker -->
<script src="<%=Url.Content("~/Scripts/jquery-1.4.1.min.js")%>" type="text/javascript"></script>
<script src="<%=Url.Content("~/Scripts/jquery-ui-1.8.1.custom.min.js")%>" type="text/javascript"></script>
<script src="<%=Url.Content("~/Scripts/fullcalendar.min.js")%>" type="text/javascript"></script>
<link href="<%= Url.Content("~/Content/jquery-ui.custom.css") %>" rel="stylesheet" type="text/css" />
<link href="<%= Url.Content("~/Content/fullcalendar.css") %>" rel="stylesheet" type="text/css"/>
<script type="text/javascript">
$(document).ready(function() {
$("#calendar").fullCalendar({
theme: true,
header: {
left: 'month, agendaWeek, agendaDay',
center: 'title',
right: 'next,prev'
},
buttonIcons: {
next: 'circle-triangle-w',
prev: 'circle-triangle-e'
},
monthNames: ['ינואר', 'פברואר', 'מרץ', 'אפריל', 'מאי', 'יוני',
'יולי', 'אוגוסט', 'ספטמבר', 'אוקטובר', 'דצמבר'],
monthNamesShort: ['ינו', 'פבר', 'מרץ', 'אפר', 'מאי', 'יונ',
'יול', 'אוג', 'ספט', 'אוק', 'דצמ'],
dayNames: ['ראשון', 'שני', 'שלישי', 'רביעי', 'חמישי', 'שישי', 'שבת'],
dayNamesShort: ['א', 'ב', 'ג', 'ד', 'ה', 'ו', 'ש'],
weekend: false,
aspectRatio: 2,
defaultView: 'agendaWeek',
isRTL: true,
axisFormat: 'HH:mm',
minTime: '6:00',
maxTime: '21:00',
events: "/Scheduler/EventData/",
allDaySlot: false,
eventClick: function(event, jsEvent, view) {
window.location(event.url);
}
});
});
</script>
<br />
<div style="padding-bottom: 10px; text-align: center; font-size:xx-large; font-family: David;">לוח ארועים</div>
<div id="calendar" style="font-size: medium"></div>
<% if (Roles.IsUserInRole("manager"))
{ %>
<div id="side" style="font-size:large; text-align: center; text-decoration: none;">
<br />
<%= Html.ActionLink("הוסף ארוע חדש", "CreateEvent", "Scheduler") %>
</div>
<% } %>
</asp:Content>
有什么想法吗?
I'm having a weird error in my code.
I'm getting an error:
Microsoft JScript runtime error: object doesn't support this action.
I'm using fullcalendar and on an event click I want to open the even details in the same window. Oddly enough, this works fine in Chrome. I also want to note that on an XP system it works fine both in IE8 and Chrome, while in Windows 7 chrome works fine and IE8 gives the error.
Here is a screen shot:
Here is my view code:
<%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/HomePagesMaster.Master" Inherits="System.Web.Mvc.ViewPage<Perspectiva.Models.EventViewModel>" %>
<asp:Content ID="Content1" ContentPlaceHolderID="TitleContent" runat="server">
פרספקטיבה - לוח ארועים
</asp:Content>
<asp:Content ID="mainContent" ContentPlaceHolderID="PageContent" runat="server">
<!-- jquery scripts needed for for the calendar and datepicker -->
<script src="<%=Url.Content("~/Scripts/jquery-1.4.1.min.js")%>" type="text/javascript"></script>
<script src="<%=Url.Content("~/Scripts/jquery-ui-1.8.1.custom.min.js")%>" type="text/javascript"></script>
<script src="<%=Url.Content("~/Scripts/fullcalendar.min.js")%>" type="text/javascript"></script>
<link href="<%= Url.Content("~/Content/jquery-ui.custom.css") %>" rel="stylesheet" type="text/css" />
<link href="<%= Url.Content("~/Content/fullcalendar.css") %>" rel="stylesheet" type="text/css"/>
<script type="text/javascript">
$(document).ready(function() {
$("#calendar").fullCalendar({
theme: true,
header: {
left: 'month, agendaWeek, agendaDay',
center: 'title',
right: 'next,prev'
},
buttonIcons: {
next: 'circle-triangle-w',
prev: 'circle-triangle-e'
},
monthNames: ['ינואר', 'פברואר', 'מרץ', 'אפריל', 'מאי', 'יוני',
'יולי', 'אוגוסט', 'ספטמבר', 'אוקטובר', 'דצמבר'],
monthNamesShort: ['ינו', 'פבר', 'מרץ', 'אפר', 'מאי', 'יונ',
'יול', 'אוג', 'ספט', 'אוק', 'דצמ'],
dayNames: ['ראשון', 'שני', 'שלישי', 'רביעי', 'חמישי', 'שישי', 'שבת'],
dayNamesShort: ['א', 'ב', 'ג', 'ד', 'ה', 'ו', 'ש'],
weekend: false,
aspectRatio: 2,
defaultView: 'agendaWeek',
isRTL: true,
axisFormat: 'HH:mm',
minTime: '6:00',
maxTime: '21:00',
events: "/Scheduler/EventData/",
allDaySlot: false,
eventClick: function(event, jsEvent, view) {
window.location(event.url);
}
});
});
</script>
<br />
<div style="padding-bottom: 10px; text-align: center; font-size:xx-large; font-family: David;">לוח ארועים</div>
<div id="calendar" style="font-size: medium"></div>
<% if (Roles.IsUserInRole("manager"))
{ %>
<div id="side" style="font-size:large; text-align: center; text-decoration: none;">
<br />
<%= Html.ActionLink("הוסף ארוע חדש", "CreateEvent", "Scheduler") %>
</div>
<% } %>
</asp:Content>
Any Ideas?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
看起来你只需要更改
window.location(event.url);
到
window.location = event.url;
我意识到这篇文章是不久前创建的,但我想我会为任何寻找答案的人发布答案。
Looks like you just need to need to change
window.location(event.url);
to
window.location = event.url;
I realize this post was created a while back, but I figured I would post the answer for anyone looking.