草庐IT

propertie

全部标签

javascript - getElementsByClassName 和 IE8 : Object doesn't support this property or method

这个问题在这里已经有了答案:javascriptdocument.getElementsByClassNamecompatibilitywithIE(7个答案)关闭8年前。我知道IE8不支持“getElementsByClassName”。你知道我可以用什么代替吗?我因错误而烦人"Objectdoesn'tsupportthispropertyormethod".HTML代码是:functionsumar(){varelems=document.getElementsByClassName('verdana14toAdd');varmyLength=elems.length;total

javascript - 未捕获的类型错误 : Cannot assign to read only property

我正在尝试NicholasZakas所著的“面向Web开发人员的专业JavaScript”一书中的这个非常简单的示例,但我不知道我在这里做错了什么。一定是我错过的非常简单的东西,但我被卡住了。代码如下:'usestrict';varbook={};Object.defineProperties(book,{originYear:{value:2004,writable:false},_year:{value:2004},edition:{value:1},year:{get:function(){returnthis._year;},set:function(newValue){if(

javascript - 错误 : Missing class properties transform

错误:缺少类属性转换Test.js:exportclassTestextendsComponent{constructor(props){super(props)}staticcontextTypes={router:React.PropTypes.object.isRequired}.babelrc:{"presets":["es2015","react","stage-0"],"plugins":["transform-class-properties"]}package.json:"babel-core":"^6.5.1","babel-eslint":"^4.1.8","bab

javascript - 脚本 438 : Object doesn't support property or method IE

我的应用程序中有一个选项,用户可以在其中停用他们的个人资料。只有管​​理员可以再次激活它们。我有一个类ActivateProfile有两个方法userExist(userName)检查具有该用户名的用户是否存在以及他/她的个人资料是否已停用和activateAccountByUser(userName)再次激活用户的个人资料我在输入类型按钮的点击事件上调用JavaScript函数。此代码在Chrome和Mozilla上运行良好,但在InternetExplorer上出现此错误:SCRIPT438:Objectdoesn'tsupportpropertyormethoduserExist

javascript - [Vue 警告] : Property or method is not defined on the instance but referenced during render

已编写以下代码来处理单击按钮后的事件varMainTable=Vue.extend({template:""+""+"{{index}})"+"{{set.title}}"+"Info"+""+"",data:function(){returndata;}});Vue.component("main-table",MainTable);data.settingsSelected={};varapp=newVue({el:"#settings",data:data,methods:{changeSetting:function(index){data.settingsSelected=d

javascript - React JSX 文件给出错误 "Cannot read property ' createElement' of undefined"

我有一个文件test_stuff.js,我正在使用npmtest运行它它看起来像这样:import{assert}from'assert';import{MyProvider}from'../src/index';import{React}from'react';constmyProvider=();describe('Array',function(){describe('#indexOf()',function(){it('shouldreturn-1whenthevalueisnotpresent',function(){assert.equal(-1,[1,2,3].index

javascript - JQuery 数据表 : Cannot read property 'aDataSort' of undefined

我创建了这个fiddle,它按照我的要求运行良好:Fiddle但是,当我在我的应用程序中使用它时,我在浏览器控制台中收到一条错误消息:Cannotreadproperty'aDataSort'ofundefined在我的应用程序中,javascript读取如下内容:我检查了Controller输出...它运行良好并且也打印在控制台上。$(document).ready(function(){$.getJSON("three.htm",function(data){//console.log("loadDataTable>>"+JSON.stringify(data));}).fail(

javascript - 更改 :hover CSS properties with JavaScript

JavaScript如何改变CSS:hover属性?例如:HTMLHover1Hover2CSStabletd:hover{background:#ff0000;}如何使用JavaScript将td:hover属性修改为background:#00ff00?我知道我可以使用JavaScript访问样式背景属性:document.getElementsByTagName("td").style.background="#00ff00";但我不知道.styleJavaScript等同于:hover。 最佳答案 像:hover这样的伪类从

javascript - 未捕获的类型错误 : Cannot read property 'top' of undefined

如果这个问题已经得到回答,我深表歉意。我试过寻找解决方案,但找不到适合我的代码的解决方案。我还是jQuery的新手。对于两个不同的页面,我有两种不同类型的粘性菜单。这是两者的代码。$(document).ready(function(){varcontentNav=$('.content-nav').offset().top;varstickyNav=function(){varscrollTop=$(window).scrollTop();if(scrollTop>contentNav){$('.content-nav').addClass('content-nav-sticky')

javascript - 类型错误 : Cannot read property 'then' of undefined

loginService.islogged()上面的函数返回一个类似“failed”的字符串。但是,当我尝试在其上运行then函数时,它将返回错误TypeError:Cannotreadproperty'then'ofundefined并且光标指示在connected之后和.then之前。下面是完整的函数:varconnected=loginService.islogged();alert(connected);connected.then(function(msg){alert("connectedvalueis"+connected);alert("msg.datavalueis"