Vue中在<a-menu-item>下使用<router-link>报"Cannot read property '_normalized' of undefined"?
vue.esm.js?efeb:1897 TypeError: Cannot read property '_normalized' of undefined
    at normalizeLocation (vue-router.esm.js?fe87:1295)
    at VueRouter.resolve (vue-router.esm.js?fe87:2622)
    at VueComponent.render (vue-router.esm.js?fe87:423)
    at VueComponent.Vue._render (vue.esm.js?efeb:3551)
    at VueComponent.updateComponent (vue.esm.js?efeb:4069)
    at Watcher.get (vue.esm.js?efeb:4482)
    at new Watcher (vue.esm.js?efeb:4471)
    at mountComponent (vue.esm.js?efeb:4076)
    at VueComponent.Vue.$mount (vue.esm.js?efeb:9057)
    at VueComponent.Vue.$mount (vue.esm.js?efeb:11953)
qq_42349895
知码力 回复俯视众生:目前还没有
5 个月之前 回复
qq_42349895
知码力 回复qq_24159477: 目前还没有
5 个月之前 回复
qq_26753055
俯视众生 同问,有解决的办法吗?
5 个月之前 回复
qq_24159477
qq_24159477 同问,有解决的办法吗?
5 个月之前 回复

1个回答

我的是给route-link 的to属性附上值就好了

qq_42349895
知码力 好的,谢谢
4 个月之前 回复
Csdn user default icon
上传中...
上传图片
插入图片
抄袭、复制答案,以达到刷声望分或其他目的的行为,在CSDN问答是严格禁止的,一经发现立刻封号。是时候展现真正的技术了!
其他相关推荐
Vue中在下使用报"Cannot read property '_normalized' of undefined"?
```rnvue.esm.js?efeb:1897 TypeError: Cannot read property '_normalized' of undefinedrn at normalizeLocation (vue-router.esm.js?fe87:1295)rn at VueRouter.resolve (vue-router.esm.js?fe87:2622)rn at VueComponent.render (vue-router.esm.js?fe87:423)rn at VueComponent.Vue._render (vue.esm.js?efeb:3551)rn at VueComponent.updateComponent (vue.esm.js?efeb:4069)rn at Watcher.get (vue.esm.js?efeb:4482)rn at new Watcher (vue.esm.js?efeb:4471)rn at mountComponent (vue.esm.js?efeb:4076)rn at VueComponent.Vue.$mount (vue.esm.js?efeb:9057)rn at VueComponent.Vue.$mount (vue.esm.js?efeb:11953)rn```
Cannot read property 'group' of undefined
我是想要通过邮箱获取验证码,然后赋值给一个隐藏的输入框,在通过bootstrapValidator验证两个值是否相等。rn[img=https://img-bbs.csdn.net/upload/201710/23/1508747436_374751.png][/img][img=https://img-bbs.csdn.net/upload/201710/23/1508747453_118507.png][/img]rn点击事件是点击之后随即用过一个工具类随机产生一个随机的6位整数并发送到邮箱,然后通过@ResponseBody返回给jsprn
Cannot read property 'renderer' of undefined
我还应该引入什么包么?求大神帮忙咯[code=html] 无标题文档 [/code]
Cannot read property 'setData' of undefined
问题阐述:rnglobal.html里有一个“id=biao1”的iframe,现欲通过js抽取iframe中div标签的文本内容并复制到剪贴板,本例欲采用clipboardData.setData方法并出现如下报错信息,请大牛指点。rnrn报错信息:rnzhiliangbaobiao.js:8 Uncaught TypeError: Cannot read property 'setData' of undefinedrn at copysql1 (zhiliangbaobiao.js:8)rn at HTMLInputElement.onclick (global.html:172)rnrnglobal.html 主要源码rnrnrnrnrnzhiliangbaobiao 主要源码rnvar ifr = document.getElementById('biao1');rnvar ifrwin = ifr.window || ifr.contentWindow;rnvar temp = ifrwin.document.getElementsByTagName("div").item(0).innerText; rnwindow.clipboardData.setData("text",temp);
Cannot read property 'options' of undefined
发生情况,服务器宕掉重启之后或者长时间停留页面,点击登陆会出现Cannot read property 'options' of undefined,报错在 $('#termAndCondition').dialog('open')这一行,页面也会出现多余的两行。rnrnjQuery 1.11.3, easyui 1.4.5rnrn[img=https://img-bbs.csdn.net/upload/201805/24/1527134358_863024.png][/img]rn涉及的代码rn[code=javascript]rn$.ajax(rn type:'POST',rn url: pageContext + '/supplier-service/validateTermAccepted.ajax', rn data:$('#frm').serialize(),rn cache: false,rn async: false, rn success : function(data) rn if(data!=null && data != "") rn $("#termAndCondition").html(data);rn $('#termAndCondition').dialog('open');rn else rn frm.submit();rn rn ,rn error: function() rn return false;rn rn ); [/code]rn[code=javascript] [/code]rn[code=java]rn @RequestMapping(value = "/validateTermAccepted", method = RequestMethod.POST)rn public ModelAndView validateTermAccepted() throws Exception rn ...... rn if (validate && entity.getAcceptTerm() == 0) rn if (Objects.equals(entity.getSupplierType(), supplierType)) rn if (entity.getSupplierType() == 3) rn return new ModelAndView("/supplier/termAndCondition_");rn else rn return new ModelAndView("/supplier/termAndCondition");rn rn rn rn return null;rn [/code]
Cannot read property 'length' of undefined 问题
[code=javascript] rn rn rn rn rn rn rn rn rn rn rn rn rn rn [/code]rn运行就出Cannot read property 'length' of undefined rn这是哪里的问题
Uncaught TypeError: Cannot read property 'path' of undefined
出现Uncaught TypeError: Cannot read property 'path' of undefined 错误,但是我所有的变量定义里都没有“path”这个东西,不知道是哪里来的?哪位大师帮忙指点一下。[img=https://img-bbs.csdn.net/upload/201406/25/1403680975_69275.jpg][/img]
Uncaught TypeError: Cannot read property 'top' of undefined
HTMLrnrnrnrn rn 多图文rn rn rn rn rnrnrnrn rn rn rn rn 封面图片rn rn rn 摘要rn rn rn 修改rn rn rn rn rn rn 标题rn rn 预览图rn rn rn rn 修改rn 删除rn rn rn rn 添加一个图文rn rnrnrn rn rn rn 标   题:rn rn rn rn 封   面:rn rn rn rn rn rn 关 联 类 型:rn rn 请选择一个关联的类型...rn 微专题rn 自定义链接rn rn rn rn 微  专 题:rn rn 圣诞特惠rn 双十二狂欢rn rn rnrn rn 自定义链接:rn rn rn rn rn rn rnrn rnrnrn rn rn rnrn查看json对象rn验证数据合法性rn模拟修改图文json数据rnrnrnrnrnJS代码:rn//当前编辑的图文IDrnvar boxIdN = 1;rnrn//一共存在多少个图文rnvar n=3;rn//图文json对象rnvar tws=[];rnvar tw=function()return"BoxId":"","Title":"","UrlType":"","TopicID":"","Url":"","Description":"","PicUrl":"","Status":""rnntw = new tw();rnntw.BoxId = 1;rntws.push(ntw);rnntw = new tw();rnntw.BoxId = 2;rntws.push(ntw);rnrn$(document).ready(function()rn $('#picfile').change(function()rn $('#fmSrc').val($(this).val());rn )rn rn $('#sBox1').hover(function()rn $(this).find('.layer_mask').show();rn ,function()rn $(this).find('.layer_mask').hide();rn );rnrn//事件on可以将动态的效果直接添加进来rn $('.tw_box').on('mouseenter mouseleave','.twSBox',function()rn $(this).find('.layer_mask').toggle(); rn );rnrn//删除图文rn $('.tw_box').on('click','.del',function()rn if($('.twSBox').length == 2)rn alert('请至少保存两个图文信息');rn elsern $(this).parent().parent().remove(); rn editTW(parseInt(1));rn rn );rn rn//追加图文rn $('.boxAdd a').click(function()rn if($('.twSBox').length < 10)rn var str=' '+' 标题 预览图 修改删除'+'';rn var ntw = new tw();rn ntw.BoxId = n;rn tws.push(ntw);rn n=n+1; rn $('.boxAdd').before(str);rn elsern alert('最多可添加10个图文');rn rn );rnrn//修改图文rn$('.tw_box').on('click','.revise',function()rn var thisId=$(this).parent().parent().attr('id');rn thisId=thisId.replace(thisId.substring(0,4),'');rn editTW(thisId);rn);rnrn);/*$(document).ready(function() end*/rnrn//修改图文rnfunction editTW(sBoxId)rn //保存对象到jsonrn saveDataToJson();rn boxIdN = sBoxId;rn //移动模型rn moveBox();rn //初始化数据,清空图文rn initBox();rn //载入模型数据对象rn loadData();rnrnrn//修改图文1rnfunction edit(sBoxId)rn //保存对象到jsonrn saveDataToJson();rn boxIdN = sBoxId;rn //初始化数据,清空图文rn initBox();rn //载入模型数据对象rn loadData();rnrnrn//移动rnfunction moveBox()rn var h = $('#sBox' + boxIdN).offset().top;rn $('#box_move').animate(top:h+'px');rn// $('#box_move').animate(top:$('#sBox'+boxIdN).offset().top,800);rnrnrn//select联动rnfunction changeType(selectVal)rn if('1' == selectVal) rn $("#topics").show();rn $("#define_link").hide();rn else if ('2' == selectVal) rn $("#topics").hide();rn $("#define_link").show();rn else if('0' == selectVal)rn $("#topics").hide();rn $("#define_link").hide();rn rnrnrn//初始化数据,清空图文rnfunction initBox()rn $("#title").val("");rn $("#picfile").val("");rn $("#typeID").val("0");rn $("#topics").hide();rn $("#define_link").hide();rn $("#valueID option").attr("selected","selected");rn $("#urlData").val("http://");rnrnrn//保存对象到jsonrnfunction saveDataToJson()rn for(var a=0; a=2)rnrn if($('.tw_box .layer_mask').length < 10)rn var str=' '+' 标题 预览图 '+$('.zzc_sBox2').html()+''+'';rn var ntw = new tw();rn ntw.BoxId = n;rn tws.push(ntw);rn n=n+1; rn $('.boxAdd').before(str);rn elsern alert('最多可添加10个图文');rn rn rn if(!isNull(tws[a].Title))rn $("#title"+(parseInt(a)+1)).text(tws[a].Title);rn rn if(!isNull(tws[a].PicUrl))rn $("#img"+(parseInt(a)+1)).attr("src",(tws[a].PicUrl)).show();rn rn rnrn当我验证Json数据时,在删除一个图文后验证会出错Uncaught TypeError: Cannot read property 'top' of undefined ,求大神帮我看下代码,非常感谢
window.document.body.innerHTML报错:Cannot read property 'body' of undefined
最近把谷歌浏览器从33升级到最新版本35,然后window.document.body.innerHTML就报错了:Cannot read property 'body' of undefined 。懂浏览器兼容性问题的大神们出来帮帮忙啊
js出现Cannot read property 'length' of undefined
js代码:rnrnrn```rn $(document).ready(function()rn var url = "teachers/getSchoolList.do";rn $.ajax(rn type: "POST",rn url: url,rn //async : false,rn dataType:"text",rn success : function(data) rn alert(data);rn alert("8888");rn var str=" ";rn console.log(data);rn $.each(data.list,function (i, value) rn str=str+" "+value[i].SCHOOLNAME+""; rn );rn str = str+"";rn $(".erjimenu").html(str);rn ,rn error:function(data)rn console.log(data);rn $("#form-notice").html('获取学校出错,请重新获取');rn rn ); rn)rn后台代码:rn @RequestMapping(value="/getSchoolList")rn public Object getSchoolList()throws Exceptionrn ModelAndView mv = this.getModelAndView();rn PageData pd = new PageData();rn pd = this.getPageData();rn Map map = new HashMap();rn List schoolList = this.schoolService.listAll(new PageData());rn map.put("list", schoolList);rn return AppUtil.returnObject(pd, map);rn rn```rnrnrn
Uncaught TypeError: Cannot read property 'className' of undefined
为什么28行会找不到classname呢?有点费解,css设置错误了么rn[code=javascript]rnrnrnrn rn 无标题文档rn rnrnrnrn rn rn Xrn rn rn QQ登录界面rn rnrn rnrnrnrn[/code]
easyui Cannot read property 'panel' of undefined
jquery.easyui.min.js:4688 Uncaught TypeError: Cannot read property 'panel' of undefinedrn at HTMLDivElement. (jquery.easyui.min.js:4688)rn at HTMLDivElement.dispatch (jquery-1.11.1.min.js:3)rn at HTMLDivElement.r.handle (jquery-1.11.1.min.js:3)rn(anonymous) @ jquery.easyui.min.js:4688rndispatch @ jquery-1.11.1.min.js:3rnr.handle @ jquery-1.11.1.min.js:3rnrn在代码中添加全关闭按钮时就报上面的错了,怎么解决.求大神指点rnif (!$('#tabs').tabs('exists', subtitle) ) rn $('#tabs').tabs('add', rn title: subtitle,//标题rn content: createFrame(url),rn fit:true,rn closable: truern );rn var li = $(".tabs-wrap ul li:last-child"); rn $("#close").remove(); rn li.after(" 关闭全部");rnrnrn关闭函数:rn//关闭全部tabsrnfunction closeAll() rn $(".tabs li").each(function(index, obj) rn //获取所有可关闭的选项卡rn var tab = $(".tabs-closable", this).text();rn $(".easyui-tabs").tabs('close', tab);rn );rn $("#close").remove();//同时把此按钮关闭rn rn
Uncaught TypeError: Cannot read property 'parentNode' of undefined
本人新人,最近在学javascript,使用chrome调试js时出现Uncaught TypeError: Cannot read property 'parentNode' of undefined,不知道如何解决,希望有人能帮忙,十分感谢·rnrnrnrnrn rn new document rn rn rn rn rn rn rn 工号rn 姓名rn 选项rn rnrn rn 01rn 小明rn 删除 rn rnrn rn 02rn 小王rn 删除 rn rnrn rn rn rnrn
报错:Cannot read property 'contentWindow' of undefined
这是封装的一个JS文件,初次使用还是正常的??再次掉用就报错了,求大神指教rnfunction initVideoNotPlay(frame,ip,port,user,psw,channel)rnrn //var window = $("#" + frame)[0].contentWindowrn //console.log($("#" + frame)[0]);rn $("#" + frame)[0].contentWindow.initVideo('divPlugin',ip,port,user,psw,'0',280,190,2,channel);//报错位置rn $("#" + frame)[0].contentWindow.clickGetLocalCfg();rn $("#" + frame)[0].contentWindow.clickSetLocalCfg(); rn rn
Uncaught typeError:Cannot read property 'style' of undefined
想实现点击某项,可弹出框,并且背景灰色且不可操作。运行后发现没弹出框,Chrome中调试发现到红色行时报错:Uncaught typeError:Cannot read property 'style' of undefinedrn各位谁知道怎么回事?怎么解决??rnjs: rnfunction locking(id) rn [color=#FF0000]document.all.zzjs_net.style.display = "block";[/color] document.all.zzjs_net.style.width = document.body.clientWidth;rn document.all.zzjs_net.style.height = document.body.clientHeight;rn $("#www_zzjs_net_" + id).css("display", "block");rnrn document.body.style.overflow = "hidden";rnrnrnrnhtml:rn );" class="menu_one" style="cursor:pointer;">rn rn <%#Eval("Number")%>.<%#Eval("MenuName_EN")%>rn rn rnrn " >
echarts图表报Uncaught TypeError: Cannot read property 'length' of undefined
相关代码如下,报错提示是echarts-all.js本身rn[img=https://img-bbs.csdn.net/upload/201809/26/1537929097_665312.png][/img]rn[img=https://img-bbs.csdn.net/upload/201809/26/1537929472_629986.png][/img]rn[img=https://img-bbs.csdn.net/upload/201809/26/1537929159_975145.png][/img]rn[img=https://img-bbs.csdn.net/upload/201809/26/1537929533_717046.png][/img]rn[img=https://img-bbs.csdn.net/upload/201809/26/1537929564_697816.png][/img]
TypeError: Cannot read property 'value' of undefined
Ext.data.JsonP.request(rn model: 'app.model.Sms',rn scope:this,rn autoLoad: true,rn url : 'XXX.action',rn params : rn id : smsInfo.ID.valuern ,rn reader: rn type: 'json',rn rootProperty: 'DET'rn ,rn success: function(result) rn var pro = result.DET;rn this.getSmsDetail().setValues(pro);rn ,rn failure : function(result) rn Ext.Msg.alert("操作失败", "装载数据失败!");rn rn );rnrnparams 哪一行的value报的错,之前写的也没错 ,怎么到这就错了呢
Cannot set property 'innerHTML' of undefined
![图片说明](https://img-ask.csdn.net/upload/201610/25/1477382907_79207.jpg)![图片说明](https://img-ask.csdn.net/upload/201610/25/1477382914_394739.jpg)nnn我想点击上面的那个+号 然后输入数据后 把数据传入到后台 ,purchaseItems["+j+"] 是自己定义的集合
Cannot read property 'style' of null
[code=javascript]rn$(document).ready(function () rn var width = document.body.clientWidth;rn var ss = parent.document.getElementById("html").id;rn alert(ss);rn document.getElementById('html').style.fontSize = width + "px";rnrnrn var height2 = window.screen.availHeight;rn document.getElementById("DingcanMain_main_right").style.height = height2 / 380 - 0.48 + "rem";rnrn)rn[/code]rnrnss可以打印出“html”,我注释了一下,所有 document.getElementById(" ") 都会报 Cannot read property 'XXX' of null的错误,问过度娘,把引用放最后也没用……给大神跪了
Cannot read property 'value' of null
![图片说明](https://img-ask.csdn.net/upload/201604/07/1460013583_495795.png)rnrn如图 想判断登陆框中的输入信息是否为空 在IE 360 等中都可以实现 但是在谷歌浏览器中不能实现 求大神解答 rnrn```rn rn```rn```rn rn rn rn rn rn rn 用户名:rn rn rn rn rn rn 密 码:rn rn rn rn rn rn rn rn rn rnrnrn```rnrnrn
cannot read property 'layer' of null
[img=https://img-bbs.csdn.net/upload/201804/17/1523960316_99642.jpg]rn[/img][img=https://img-bbs.csdn.net/upload/201804/17/1523959972_505062.png][/img]rn无法进入yes确定按钮回调方法
Extjs异常:Uncaught TypeError: Cannot read property 'internalId' of undefined
我在开发中碰到这样一个问题:rn一个tree,我后台给它传的json中包含id的话,在对树的一些应用到id的操作时就会碰到这样的异常:Uncaught TypeError: Cannot read property 'internalId' of undefined 。如果不传id就正常了,但是某些和id相关的操作就做不了,或者很麻烦。
ajax同步后出现Cannot read property 'length' of undefined
[code=javascript]rn$.ajax(rn url: "<%=request.getContextPath()%>/chargegroup?operateFlag=initgroup", rn type: "post", rn dataType:"json", rn async:false,rn success:function(data)rn var group=data.message;rn for(var i=0;i
运行Node.js,TypeError: Cannot read property 'prototype' of undefined
[size=18px][size=16px]大家好,我是Node.js新手,请教大神。rn我按照《Nodejs实战》中第一张的案例编写代码,代码检查了几次,node也装了最新版本,运行server.js 的时候,但还是出现以下错误。rnrnC:\Users\Administrator\Desktop\chatrooms>node server.jsrnC:\Users\Administrator\Desktop\chatrooms\node_modules\socket.io\lib\store.js:35rnStore.prototype.__proto__ = EventEmitter.prototype;rn ^rnrnTypeError: Cannot read property 'prototype' of undefinedrn at Object. (C:\Users\Administrator\Desktop\chatrooms\node_modules\socket.io\lib\store.js:35:41)rn at Module._compile (module.js:571:32)rn at Object.Module._extensions..js (module.js:580:10)rn at Module.load (module.js:488:32)rn at tryModuleLoad (module.js:447:12)rn at Function.Module._load (module.js:439:3)rn at Module.require (module.js:498:17)rn at require (internal/module.js:20:19)rn at Object. (C:\Users\Administrator\Desktop\chatrooms\node_modules\socket.io\lib\manager.js:16:13)rn at Module._compile (module.js:571:32)rnrn提示是不能运行prototype,我贴一下关于prototype的代码吧。rn[code=javascript]rnvar Chat = function(socket) rn this.socket = socket;rn;rnrn//添加发送聊天消息的函数rnChat.prototype.sendMessage = function(room, text) rn var message = rn room: room,rn text: textrn ;rn this.socket.emit('message', message);rn;rnrn//变更房间的函数rnChat.prototype.changeRoom = function(room) rn this.socket.emit('join', rn newRoom: roomrn );rn;rnrn//处理聊天命令rnChat.prototype.processCommand = function(command) rn var words = command.split(' ');rn var command = words[0]rn .substring(1, words[0].length)rn .toLowerCase();rn var message = false;rnrn switch(command) rn case 'join':rn words.shift();rn var room = words.join(' ');rn this.changeRoom(room);rn break;rnrn case 'nick':rn words.shift();rn var name = words.join(' ');rn this.socket.emit('nameAttempt', name);rn break;rnrn default:rn message = 'Unrecognized command.';rn break;rn rnrn return message;rn;rn[/code]rnrn谢谢你的回答。
js问题,浏览器报错Cannot read property 'id' of undefined
我在编程时产生如下错误:rnvar buttons = main.getElementsByTagName("input");rn for (i = 0; i < buttons.length; i++) rn buttons[i].onclick = function () addItem(buttons[i].id, "sides"); ;[color=#FF0000]//报错rt[/color]rn rnrnrnrnvar buttons = main.getElementsByTagName("input");rn for (i = 0; i < buttons.length; i++) rn var id = buttons[i].id;rn buttons[i].onclick = function () addItem(id, "sides"); ;[color=#FF0000]//正常[/color]rn rnrn这个是什么原理,没弄明白
Uncaught TypeError: Cannot read property 'split' of undefined 什么问题
字符串的形式是这样的rn"01,02,03#02,03,05,08,07,06,01|02#03,05,06,08"rnrn我要得到#前的字符把他们变为数组rn就是01,02,03 还有 02rnrnrnvar tz=abuy[i].split("|"); //分割单注前后区 tz[0]前面部分 tz[1]后面部分rn var qdm=tz[0].split("#"); //rn //var dm=qdm[0].split(","); //rn var hdm=tz[1].split("#"); //rn //var dm2=hdm.split(",");//rn if(qdm.length>1)rn alert(qdm[0]); 这个部分可以执行,弹出 01,02,03rn var qd=qdm[0].split(","); rn alert(qd.length);// 这里就不行了,不知道什么原因,rn alert(qd);rn
chrome.tabs.getCurrent为什么报错Cannot read property 'getCurrent' of undefined
我在manifest.json的"contentScript"注入一段代码dd.js(且"run_at": "document_end","match"也给了对应的条件)。另外"permissions": ["storage","tabs","activeTab","https://*/*" ],应该是没有遗漏的。rnrnrn现在在dd.js上写:rnchrome.tabs.getCurrent(function(tab)rn console.log(tab);rn );rn//输出:Uncaught TypeError: Cannot read property 'getCurrent' of undefinedrnrnrn这问题我在stackflow上找了很多答案,有人说不能在popup和background上写,不过我这是contentscript上注入的所以应该不是这问题;有人说要用getSelect来写,但这玩意儿不是淘汰了嘛?有人说可以用query来写,但我觉得这好像小题大做了而且试过了也不行。最重要的是实在看不出getcurrent哪里错了。。。。多简单的一个语句啊,为嘛就错了呢。。。rnrn
Uncaught TypeError: Cannot read property 'options' of undefined怎么解决?
[img=https://img-bbs.csdn.net/upload/201711/08/1510121281_150701.png][/img]rn[img=https://img-bbs.csdn.net/upload/201711/08/1510121290_854362.png][/img]rnrn一般出现这种情况都是怎么回事啊?是不是要很懂JQuery内核才能明白?rn[img=https://img-bbs.csdn.net/upload/201711/08/1510121458_265182.png][/img]rn[code=html] 查询[/code]rn[code=javascript] manager_tool = rn search: function () rn $('#manager').datagrid('load', rn manager: $('input[name="user"]').val(),rn startDate: $('input[name="date_from"]').datebox('getValue'),rn endDate: $('input[name="date_to"]').datebox('getValue')rn );rn ,[/code]rnrn按钮设置了函数,怎么点了没反应,反而再控制台报出错误?rn
求大神解决Cannot read property '0' of undefined问题
function selectGold()rn var prodCode = $("#_prodCode").val();rn ca.ajax.doAjax(rn url : '$webroot/goldSaleSelect.json',rn method : 'post',rn data : jQuery.param(prodCode:prodCode,true),rn success : function(response) rn alert("@@@@@"+2135637);rn var prodHtml = "";rn var num = Number(response.data.totalCount);rn for ( var i = 0; i < num; i++) rn prodHtml +="";rn prodHtml +=" ";rn prodHtml +=" "+response.data.list[i].prodCode+"";rn prodHtml +=" "+response.data.list[i].prodName+"";rn prodHtml +=" "+response.data.list[i].price+"";rn prodHtml +=" "+response.data.list[i].prodType+"";rn prodHtml +=" "+response.data.list[i].backFlag+"";rn prodHtml +=" "+response.data.list[i].custodyFlag+"";rn prodHtml +=" ";rn prodHtml += "";rn rn $('#selectedProds').append(prodHtml);rn rn );rnrnrnrn通过Ajax访问后台,获取数据后返回,运行SUCCES中的方法,每次运行到response.data.list[i].prodCode的时候就会报Cannot read property '0' of undefined的错,求大神指点这是为什么啊?找不到解决的方法了,在线等大神
js出现Cannot read property 'pageInfo' of undefined错误
[code=javascript]function build_emps_table(result)rn var emps = result.extend.pageInfo.list;rn $.each(emps,function(index,item)rn var empIdTd = $("").append(item.empId);rn var empNameTd = $("").append(item.empName);rn var genderTd = $("").append(item.gender=="M"?"男":"女");rn var emailTd = $("").append(item.email);rn var deptNameTd = $("").append(item.department.deptId);rn $("").append(empIdTd)rn .append(empNameTd)rn .append(genderTd)rn .append(emailTd)rn .append(deptNameTd)rn .appendTo("#emps_table tbody");rn );[img=https://img-bbs.csdn.net/upload/201812/02/1543742247_10787.png][/img]rn [/code][img=https://img-bbs.csdn.net/upload/201812/02/1543742270_806276.png][/img]
$.getJSON报错Uncaught TypeError: Cannot read property 'id' of undefined
[code=javascript]rninput.keyup(function()rn var $key = input.val();rn if($key=='')rn suggestWrap.hide();rn elsern $.getJSON('__URL__/countryType',ckey:$key,function(data)rn if (data.data!=null)rn suggestWrap.show();rn $('#add li[text!=""]').remove();rn for (var i=0;i<=data.data.length;i++)rn var option = " "+data.data[i].id+"";rn $(option).appendTo('#add');rn rn elsern suggestWrap.hide();rn rn ); rn rn )rn[/code]rn使用$.getJSON时总报这样的错rnUncaught TypeError: Cannot read property 'id' of undefined
Discuz 登录Uncaught TypeError: Cannot read property 'indexOf' of undefined
登录不上,求解rn[img=https://img-bbs.csdn.net/upload/201705/02/1493703691_264282.png][/img]
easyui 页面加载出错 Cannot read property 'options' of undefined
我有一个JSP页面,其中有一个PANEL,当点击页面上一个图标时,PANEL加载另一个子JSP,这个子JSP中的FORM有以下元素rn这是一个下拉列表rn[img=https://img-bbs.csdn.net/upload/201507/10/1436509512_374200.png][/img]rnrnrn[img=https://img-bbs.csdn.net/upload/201507/10/1436509585_653209.png][/img]rnrnrn每当点图标加载页面时,从页面就会报出一个错误,而且只有每次刷新页面后第一次点图标时才会报这个错,从第二次之后就不会报了。rn [img=https://img-bbs.csdn.net/upload/201507/10/1436509457_77193.jpg][/img]
谷歌提示:Uncaught TypeError: Cannot read property '0' of undefined
[code=html]rnrnrnrn rn rn rn Documentrn rn rnrnrnrn rn rn rn rn rn rn rn rn rn rn rn rn rn rn rn rnrnrnrn[/code] rn[code=javascript]window.onload = function () rn var Document = document;rn var img = Document.querySelectorAll("img");rn var inpt = Document.querySelector("input");rn var leg = img.length;rn var arr = [];rn var Imax = null;rn var max1 = null;rn var ls = null;rn var thisindex = null;rn max1 = img[0].style.zIndex;rn for (var i = 0; i < leg; i++) rn //利用二维数组储存rn arr.push([img[i].offsetLeft, img[i].offsetTop]);rn img[i].style.index = i;rn (function () rn var tem = i; //采用闭包方式使新创建的变量留存在内存当中,重新申明多个tem ,不同的tem里面存储着不同的值 rn img[i].onmousedown = function (ev) rn rn ev = ev || window.event;rn var x = ev.clientX - img[tem].offsetLeft;rn var y = ev.clientY - img[tem].offsetTop;rn var This = this;rn //可以不单独写函数获取最大值 ,采用Imax++累加 rn Imax = Max(1)rn if (Imax == "") rn img[tem].style.zIndex += 1;rnrn rn if (Imax >= img[tem].style.zIndex) rn img[tem].style.zIndex = parseInt(Imax) + 1;rn rn //注意:如果是直接拖拽图片,会触发浏览器的默认行为,会对onmouseup事件产生影响rn ev.preventDefault();rn Document.onmousemove = function (ev) rn ev = ev || window.event;rn img[tem].style.left = ev.clientX - x + "px";rn img[tem].style.top = ev.clientY - y + "px";rn for (var i = 0; i < leg; i++) rn img[i].style.border = "";rn rn var a = dista(This, img)rn if (a) rn ls = a;rn a.style.border = "1px solid red";rn rnrn rn Document.onmouseup = function () rn for(var i = 0; i < leg ;i++)rn img[i].style.border = "";rn rn //调换图片位置rn if( ls )rn Hh(This,ls)rn rn Document.onmousemove = Document.onmouseup = null;rnrn rn rnrn )()rn rn inpt.onclick = function dg()rn /*rn Math.ceil(); //向上取整。 rn Math.floor(); //向下取整。rn Math.round(); //四舍五入。rn */ rn console.log("2");rn var Lt = leg - 1;rn var ram_1 = Math.round(Math.random()*Lt);rn var ram_2 = Math.round(Math.random()*Lt);rn if( ram_1 != ram_2 )rn Hh(img[ram_1],img[ram_2])rn else rn //递归rn dg();rn rn rn rn posiT(img, arr)rnrn // 递归找出最大值rn function Max(i) rn var leng = img.length;rn if (i == leng) rn return max1rn rn if (max1 < parseInt(img[i].style.zIndex)) rn max1 = parseInt(img[i].style.zIndex);rnrn rn return Max(i + 1)rn rnrn //换位rn function Hh(obj1,obj2)rn // console.log(obj1,obj2)rn console.log(arr)rn obj1.style.left = arr[obj2.style.index][0] + "px";rn obj1.style.top = arr[obj2.style.index][1] + "px"; rn obj2.style.left = arr[obj1.style.index][0] + "px";rn obj2.style.top = arr[obj1.style.index][1] + "px";rn //换位后将下标也一起调换,不然调换完后无法调换回来rn thisindex = obj1.style.index;rn obj1.style.index = obj2.style.index;rn obj2.style.index = thisindex;rn rnrnrn//动态实现定位rnfunction posiT(obj, ar) rn for (var i = 0; i < obj.length; i++) rn obj[i].style.position = "absolute";rn obj[i].style.left = ar[i][0] + "px";rn obj[i].style.top = ar[i][1] + "px";rn rnrn//检测碰撞rnfunction coll(obj1, obj2) rn var R1left = obj1.offsetLeft; //左面rn var R1top = obj1.offsetTop; //上面rn var R1right = obj1.offsetLeft + obj1.offsetWidth; //右边面rn var R1bottom = obj1.offsetTop + obj1.offsetHeight; //底部面rnrn var R2left = obj2.offsetLeft;rn var R2top = obj2.offsetTop;rn var R2right = obj2.offsetLeft + obj2.offsetWidth;rn var R2bottom = obj2.offsetTop + obj2.offsetHeight;rnrn if (R1left > R2right || R1right < R2left || R1top > R2bottom || R1bottom < R2top) rn return falsern else rn return truern rnrnrnfunction dista(obj1, obj2) rn var value = 9999;rn var index = null;rnrn for (var i = 0; i < obj2.length; i++) rn if (coll(obj1, obj2[i]) && obj1 != obj2[i]) rn var c = gg(obj1, obj2[i])rn //找出C面值后,在找出这个值对应的位置rn if (c < value) rn value = c;rn index = i;rn rn rn rnrn if (index != -1) rn return obj2[index]rn else rn return falsern rnrn//找出两个边的距离后用勾股定理找出C边rnfunction gg(obj1, obj2) rn var objLeft = obj1.offsetLeft - obj2.offsetLeft;rn var objtop = obj1.offsetTop - obj2.offsetTop;rn //sqrt (a²+b²)=c²开平方根rn return Math.sqrt(objLeft * objLeft + objtop * objtop)rnrn[/code]rnrn谷歌浏览器下点击随机切换照片那里出的错,点几次不会出现,点多几次就会出错。火狐下没有这种问题,实在找不到哪里出的BUG了,求大神帮忙调试下
vue中通过ajax获取数据时,如何避免绑定的数据中出现property of undefined 或者 cannot read property *** of null 错误
vue中通过ajax获取数据时,如何避免绑定的数据中出现 &quot;property of undefined &quot;错误或者 &quot;cannot read property *** of null&quot;因为获取服务器是异步的,所以 vue 先绑定数据。如果是通过 ajax 异步获取的,在获取之前,data中的属性值是未定义的。此时在外面的标签上添加一个 v-if=&quot;???&quot; 可以避免这样的错误...
在用vuex的时候报一个很‘坑嗲’的错误:Cannot read property 'dispatch' of undefined
在用vuex的时候报一个很‘坑爹’的错误,如下图: 我找了很久才找到原因,其他代码都没问题,就是报了上面那个错误,原来是我在main.jsimport store from './store.js'的问题 如图: 这样就会报错, 后来我改成小写之后: 错误就消失了,原因很简单:如果是大小Store,根据es6法则,它会解析成:Store:Store. 通常我引入一个组件,...
vue项目上线后页面偶尔报错cannot read property 'call' of undefined
近期用vue做了一个微信公众号的项目,后来发现页面偶尔会白屏,控制台报错cannot read property 'call' of undefined,找了很久也找不到具体错误。几乎每个页面都出现过这个报错,所以我在怀疑是不是我们项目框架的问题,但是我自己对这一方面不是太懂,求大神们帮忙,万分感谢。[img=https://img-bbs.csdn.net/upload/201803/17/1521277041_368519.jpg][/img][img=https://img-bbs.csdn.net/upload/201803/17/1521277478_372641.jpg][/img]
Uncaught TypeError: Cannot read property 'replace' of null
formatter : function(value,v,row) rn var res = ' ';rn [color=#FF0000]var str='sdfhsdf';[/color]rn debugger;rn if(trim(row.disabled) == '1')rn res = '';rn elsern [color=#FF0000]str=(row.factorDetail).replace(";","。");;[/color]rn //alert(str);rn res =' 'rn +' 'rn +'天蓝蓝'+str+''rn +'';rn rn return res;rn ,rn红色部分在运行,使用alert的时候可以弹出,但是会出现如下错误:rnUncaught TypeError: Cannot read property 'replace' of nullrn at HTMLTableElement.formatter (input.do?id=1F366563E85B47DD9E5B802BEE4DDAFE:162)rn at x (jquery.jqGrid.min.js:50)rn at G (jquery.jqGrid.min.js:50)rn at Y (jquery.jqGrid.min.js:66)rn at Object.success (jquery.jqGrid.min.js:81)rn at fire (jquery-1.11.1.js:3119)rn at Object.fireWith [as resolveWith] (jquery-1.11.1.js:3231)rn at done (jquery-1.11.1.js:9275)rn at XMLHttpRequest.callback (jquery-1.11.1.js:9685)rn在线等,这是什么原因,该如何解决
微信小程序 。cannot read property 'map'
如图:mac系统上。微信开发工具模拟器,各种手机模式都正常,不报错。rn [img=https://img-bbs.csdn.net/upload/201704/12/1491993683_907311.jpg][/img][img=https://img-bbs.csdn.net/upload/201704/12/1491993699_101153.png][/img]rnrn如图,换手机没用。
怎么解决Cannot read property 'getElementsByTagName' of null
[code=text]<%@ page language="java" contentType="text/html; charset=UTF-8"rn pageEncoding="UTF-8"%>rn<%@ page import="entity.*,java.util.List,dao.impl.*"%>rn<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>rnrnrnrn rn Insert title herern rn rn [/code]rnrnrnrn[code=java]package servlet;rnrnimport java.io.IOException;rnimport java.io.PrintWriter;rnimport java.sql.ResultSet;rnimport java.sql.SQLException;rnrnimport javax.servlet.ServletException;rnimport javax.servlet.annotation.WebServlet;rnimport javax.servlet.http.HttpServlet;rnimport javax.servlet.http.HttpServletRequest;rnimport javax.servlet.http.HttpServletResponse;rnrnimport util.DBUtil;rnrn/**rn * Servlet implementation class ZyServletrn */rn@WebServlet("/ZyServlet")rnpublic class ZyServlet extends HttpServlet rn private static final long serialVersionUID = 1L;rn rn /**rn * @see HttpServlet#HttpServlet()rn */rn public ZyServlet() rn super();rn // TODO Auto-generated constructor stubrn rnrn /**rn * @see HttpServlet#doGet(HttpServletRequest request, HttpServletResponse response)rn */rn protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException rn // TODO Auto-generated method stubrn response.getWriter().append("Served at: ").append(request.getContextPath());rn response.setContentType("text/xml;charset=utf-8");rn String xyid=request.getParameter("xy");rn PrintWriter out = response.getWriter();rn String SQL_SELECT="SELECT * FROM ZY";rn DBUtil db=new DBUtil();rn db.getConnection();rn String sql=SQL_SELECT+" where xyid=?";rn ResultSet rs = db.executeQuery(sql, new String[] xyid);rn out.print("");rn try rn while(rs.next())rn String a,b;rn a=rs.getString("id");rn b=rs.getString("zy");rn out.print("");rn out.print(""+b+"");rn out.print(""+a+"");rn out.print("");rn rn catch (SQLException e) rn // TODO Auto-generated catch blockrn e.printStackTrace();rn rn out.print("");rn out.flush(); rn out.close();rn rnrn /**rn * @see HttpServlet#doPost(HttpServletRequest request, HttpServletResponse response)rn */rn protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException rn // TODO Auto-generated method stubrn doGet(request, response);rn rnrn[/code]rnrn百度到说问题是因为response.setContentType("text/xml;charset=utf-8");这个的问题 可是写上了还是不对 求解0.0
相关热词 c# 标准差 计算 c#siki第五季 c#入门推荐书 c# 解码海康数据流 c# xml的遍历循环 c# 取 查看源码没有的 c#解决高并发 委托 c#日期转化为字符串 c# 显示问号 c# 字典对象池