草庐IT

Week_OF_Month

全部标签

javascript - CSS 和 JavaScript : Get a list of CSS custom attributes

来自这段代码:HTMLCSS.test{background-color:red;font-size:20px;-custom-data1:value1;-custom-data2:150;-custom-css-information:"loremipsum";}使用javascript——例如从$('.test')——我如何才能得到一个CSS属性列表,其属性名称以前缀“-custom-”开头“?(他们可以有不同的名字,但总是相同的前缀)我想得到这个:{customData1:"value1",customData2:150,customCssInformation:"loremip

javascript - Vue.js : "TypeError: Cannot set property props of#<Object> which has only a getter"

我正在尝试实例化一个Vue组件,但出现错误:[Vuewarn]:Errorinrender:"TypeError:Cannotsetpropertypropsof#whichhasonlyagetter"(foundin)我也在使用库vuedraggable但我认为这个问题更多的是Vue问题而不是vuedraggable问题。下面是我的代码。这里是draggable-list.vue可拖动列表.jsconstdraggable=require("vuedraggable");module.exports={name:"draggable-list",components:{dragga

javascript - 三.Object3D.add : object not an instance of THREE. Object3D

所以我遇到了这个错误,但我找不到它的来源。我相信这与我在场景中导入和创建3d对象有关,但我不确定我做错了什么。代码如下:我在调用init之前调用此函数functionloadObjects(){loader=newTHREE.JSONLoader();varfloorDiskmaterial=newTHREE.MeshPhongMaterial({map:THREE.ImageUtils.loadTexture('img/floor_test.jpg'),transparent:true,color:0xeaeaea,ambient:0xeaeaea,overdraw:0.5,//sp

javascript - 执行 Action 时 redux 出错 : Uncaught type error: cannot read property 'type' of undefined

刚刚接触React。我想这是一个基本问题,但我不明白为什么reducer没有被解雇或更新状态:我的HomeView.js:....const{localeChange,counter,locale}=this.propsreturn(increment(7)}>Increment.....)constmapStateToProps=(state)=>({locale:state.locale,counter:state.counter})exportdefaultconnect(mapStateToProps,{localeChange,increment})(HomeView)我的r

javascript - 未捕获的类型错误 : Failed to execute 'observe' on 'MutationObserver' : parameter 1 is not of type 'Node'

所以我下面的代码在jsfiddle中独立运行。但出于某种奇怪的原因..在将它推送到实时服务器后,我一直收到此错误:/我无法弄清楚为什么......错误:mycodewitherror.js:23UncaughtTypeError:Failedtoexecute'observe'on'MutationObserver':parameter1isnotoftype'Node'.js:$(document).ready(function(){//Thebelowcollectsuserloginname,newlogindateandtime,andprevioususeURLvarelem

javascript - HTMLCollections 可以用 for...of (Symbol.iterator) 迭代吗?

DOM4使NodeList可迭代:interfaceNodeList{getterNode?item(unsignedlongindex);readonlyattributeunsignedlonglength;iterableNode>;};根据WebIDL,这意味着Objectsimplementinganinterfacethatisdeclaredtobeiterablesupportbeingiteratedovertoobtainasequenceofvalues.Note:IntheECMAScriptlanguagebinding,aninterfacethatisit

javascript - 如何解决 “cannot call method … of undefined” 错误?

functioncalcRoute(){varstart=document.getElementById("start_").value;varend=document.getElementById("end_").value;varrequest={origin:start,destination:end,travelMode:google.maps.TravelMode.DRIVING};directionsService.route(request,function(response,status){if(status==google.maps.DirectionsStatus.

javascript - 错误 "Uncaught TypeError: Cannot read property ' __count' of undefined"in grid datasource

我最近更新了我的jQuery和KendoUI版本。现在使用jQuery1.12.13和KendoUI2016.3.914(不确定它在他们的公共(public)网站上对应的版本,但可能在R32016左右)。似乎kendo或jQuery对数据格式变得更加严格。我有一个带有数据源的剑道UI网格,该数据源具有type:"json"。这在早期版本中有效但不再适用-它给出了警告:未知的数据源传输类型“json”。验证该类型的注册脚本是否包含在页面上的KendoUI之后。所以我查看了文档并将类型更改为odata。这给出了一个错误:VM94003:3未捕获类型错误:无法读取未定义的属性“__count

javascript - 类型错误 : Failed to set the 'buffer' property on 'AudioBufferSourceNode' : The provided value is not of type 'AudioBuffer

我正在处理现有的codoCircle.调低音量。它按预期运行。现在我想在codepen中使用相同的代码我得到这个错误类型错误:无法在“AudioBufferSourceNode”上设置“缓冲区”属性:提供的值不是“AudioBuffer”类型我做了一些研究,找到了firstanswer有用。答案是当我在playSoundplayer.buffer=buffer中分配时,缓冲区仍未定义,因为加载回调尚未触发。这对我来说很有意义,所以我尝试做一个setTimeout像:setTimeout(playSound,9000);没有成功。你知道解决这个问题的方法吗?为什么在CodeCircle中

Javascript 权威指南 : the confusion of steps of converting object to a string

根据Javascript权威指南第6版3.8.3节:Toconvertanobjecttoastring,JavaScripttakesthesesteps:•IftheobjecthasatoString()method,JavaScriptcallsit.Ifitreturnsaprimitivevalue,JavaScriptconvertsthatvaluetoastring(ifitisnotalreadyastring)andreturnstheresultofthatconversion.Notethatprimitive-to-stringconversionsarea