开发者问题收集
我试图将所有用户的个人资料照片存储在实时数据库中,但遇到了一个问题。尝试使用此代码上传 PhotoUrl 时,会出现此错误。代码:var user = firebase.auth().currentUser;user.updateProfile({// Here, "name" and "imgUrl" are parameters of parent function.// I don't th
我的点唱机应用程序在播放完播放列表中的所有歌曲后不会重新开始。相反,它会停止所有功能。到目前为止,它可以播放、暂停、停止、返回和下一首。当它播放完最后一首歌曲后,我点击“下一首”,什么也没发生,其他功能也不起作用。Jukebox.prototype.next = function() {this.jamz[index].pause();index++this.jamz[index].current
当我运行下面的代码时,出现以下错误:Uncaught TypeError: Cannot set property 'background' of undefined我做错了什么?for(var n = 0; n < 5; n++) {var heads='head'+n;var image="images/"+heads+".jpg";console.log(heads);document.ge
我一直在尝试使用自定义 JavaScript 更改位于页脚区域的品牌图像(在 WordPress 中)的 a href,我认为图像和 URL 在此处定义: <!-- !Bottom-bar --><div id="bottom-bar" role="contentinfo"><div class="wf-wrap"><div class="wf-container-bottom"><div c
我正在尝试为自己的网站创建一个编辑器(基于 contentEditables 和 HTML5 拖放功能)。这是 fiddle:https://jsfiddle.net/5bw320zo/1/请注意,代码很乱,它只是一个 POC问题:每次我悬停占位符时,占位符的 parentNode 似乎都设置为 null。Uncaught TypeError:Cannot read property 'remov
我创建了一个构造函数(并将其放在预加载函数之上),如下所示character = function(CharX,CharY,CharSpeed){this.x = CharX ;this.y = CharY;this.speed = CharSpeed;this.AddSpriteSheet = function (SprX,SprY,key) {this.character = game.ad
我一直试图将 openweathermap 的 api 数据与 google map 的 api 数据合并。但是,每当我尝试使用 innerHTML 从 api 获取数据时,它都会显示Uncaught TypeError: Cannot set property 'innerHTML' of null。Javascriptvar map;var weather;var temp;var APPID
我需要使用 for in 为数组 colors 中的每个 div 分配一种颜色var colors = ["#232323","#343434","#555555","#989889","#987898","#458676"]var squares=document.querySelectorAll(".square")for (i=0; i<squares.length; i++){square
我遇到了以下错误:Error: Uncaught (in promise): TypeError: Cannot set property 'test_id' of undefinedTypeError: Cannot set property 'test_id' of undefined错误在此行触发: console.log('after view init testList', thi
我想获取选择选项的数据属性,但是它不起作用html <select class="form-control" id="device-selection" style="width:300px;"><option selected="selected">Choose!</option><option data-width="1080" data-height="1920">Huewai p9</
此代码生成错误:Uncaught TypeError: Cannot set property '0' of undefined我想在数组中分配随机数,请帮忙。var array;for (var i = 1; i < 10; i++) {array[i] = Math.floor(Math.random() * 7);}console.log(array);
我尝试根据验证创建自定义错误消息和样式(我了解插件,但协调验证插件与 Materialize 所需的时间对于单个字段来说太多了)。HTML:<div class="input-field inline center-align"><input id="quantity" name="quantity" type="number" class=""><label for="qty" data-err
fabric.Canvas.prototype.getItemsByName = function(name) {var objectList = [],objects = this.getObjects();for (var i = 0, len = this.size(); i < len; i++) {if (objects[i].name && objects[i].name === na
我还没有更新过这个辅助站点的脚本,只有数据库产品信息。我是一名平面和网页设计师,对 html 和 css 比较了解,但对 javascript 了解不多。网页:http://westcoastnaturals.com/productsdesp.php错误导致显示产品信息的 javascript 部分无法呈现。Error:Uncaught TypeError: Cannot read propert
我试图让每次点击随机按钮时,都会显示一个新的 div 的内部 HTML - 但是我在 Javascript 控制台中收到错误消息“无法设置属性”。有人能解释一下这是什么意思以及我做了什么导致它吗?<h1>Test</h1><div id="quote1">this is quote number 1</div><p id="quote 2">this is quote number 2</p><d