本文介绍了Object不支持此属性或方法的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述 29岁程序员,3月因学历无情被辞! 您好, 我正在做一个项目,我已经为datepicker写了一个jquery和系统空闲时间。它正在适用于mozila和谷歌浏览器,但无法在IE8或IE11上工作并抛出以下错误消息。 对象不支持此酒店或方式 i有以下页面代码 这是系统空闲时间: < script 类型 = text / javascript > idleMax = 5; // IDLE idleTime = 0 5分钟后退出; $(document).ready(function(){ var idleInterval = setInterval(timerIncrement(),60000); $(this).mousemove(function(e){idleTime = 0;}); $(this).keypress(function(e){idleTime = 0;}); }) function timerIncrement(){ idleTime = idleTime + 1; if(idleTime> idleMax){ window.location =../ login.aspx; } } < / script > 此代码适用于Datepicker: < asp:TextBox ID = txtdate1 runat = server AutoPostBack = True OnTextChanged = txtdate1_TextChanged > < / asp:TextBox > < asp:HiddenField ID = HiddenField1 runat = server / > < script type = text / javascript > $(document).ready(function(){ $(input [id $ = txtdate1])。datepicker({ changeMonth:true, changeYear :true, maxDate:'0', altField:'[id $ = HiddenField1]'}); if($([id $ = HiddenField1])。attr(Value)。length> 0){ $([id $ = txtdate1])。datepicker( setDate,new Date($([id $ = HiddenField1])。attr(Value))); } }); < / script > 请尽快帮助我.... 解决方案 (document).ready(function(){ var idleInterval = setInterval(timerIncrement(),60000); (this).mousemove(function( e){idleTime = 0;}); (this).keypress(function(e){idleTime = 0;}); })函数timerIncrement(){ idleTime = idleTime + 1; if(idleTime> idleMax){ window.location =../ login.aspx; } } < / script > 此代码适用于Datepicker: < asp:TextBox ID = txtdate1 runat = server AutoPostBack = True OnTextChanged = txtdate1_TextChanged > < / asp:TextBox > < asp:HiddenField ID = HiddenField1 runat = server / > < script type = text / javascript > Hello, I m doing a project in which i have written a jquery for datepicker and system idle time. It is properly working on mozila and google chrome but doesn't work on IE8 or IE11 and throwing following error message."Object doesn't support this property or method"i have following code for pagethis is for System idle time:<script type="text/javascript"> idleMax = 5; // Logout after 5 minutes of IDLE idleTime = 0; $(document).ready(function () { var idleInterval = setInterval("timerIncrement()", 60000); $(this).mousemove(function (e) { idleTime = 0; }); $(this).keypress(function (e) { idleTime = 0; }); }) function timerIncrement() { idleTime = idleTime + 1; if (idleTime > idleMax) { window.location = "../login.aspx"; } }</script>And this code is for Datepicker:<asp:TextBox ID="txtdate1" runat="server" AutoPostBack="True" OnTextChanged="txtdate1_TextChanged"></asp:TextBox> <asp:HiddenField ID="HiddenField1" runat="server" /> <script type="text/javascript"> $(document).ready(function () { $("input[id$=txtdate1]").datepicker({ changeMonth: true, changeYear: true, maxDate: '0', altField: '[id$=HiddenField1]' }); if ($("[id$=HiddenField1]").attr("Value").length > 0) { $("[id$=txtdate1]").datepicker("setDate", new Date($("[id$=HiddenField1]").attr("Value"))); } }); </script>Please help me as soon as possible.... 解决方案 (document).ready(function () { var idleInterval = setInterval("timerIncrement()", 60000);(this).mousemove(function (e) { idleTime = 0; });(this).keypress(function (e) { idleTime = 0; }); }) function timerIncrement() { idleTime = idleTime + 1; if (idleTime > idleMax) { window.location = "../login.aspx"; } }</script>And this code is for Datepicker:<asp:TextBox ID="txtdate1" runat="server" AutoPostBack="True" OnTextChanged="txtdate1_TextChanged"></asp:TextBox> <asp:HiddenField ID="HiddenField1" runat="server" /> <script type="text/javascript"> 这篇关于Object不支持此属性或方法的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持! 上岸,阿里云!
08-04 18:09
查看更多