【jQuery】jquery中 使用$('#parentUid').attr(parentUid);报错jquery-1.11.3.min.js:5 Uncaught TypeError: Cannot read property 'nodeType' of undefined
jquery中 使用$('#parentUid').attr(parentUid);报错jquery-1.11.3.min.js:5 Uncaught TypeError: Cannot read property 'nodeType' of undefined
错误原因:
是因为在attr();中未指定 具体将值赋给这个元素的那个结点,所以报错 找不到节点类型。
解决方法:
如果本元素是input,可以直接使用$('#parentUid').val(parentUid);
如果本元素是img,可以使用$('#parentUid').attr(“src”,parentUid); 指定给具体的本元素中的哪个属性赋值
【jQuery】jquery中 使用$('#parentUid').attr(parentUid);报错jquery-1.11.3.min.js:5 Uncaught TypeError: Cannot read property 'nodeType' of undefined的更多相关文章
- js 报错 Uncaught TypeError: Cannot read property 'trim' of undefined
jquery Uncaught TypeError: Cannot read property 'trim' of undefined 报错原因及解决方案 $.trim() 函数用于去除字符串两端的空 ...
- DataTable插件报错:Uncaught TypeError: Cannot read property 'style' of undefined
DataTable插件报错:Uncaught TypeError: Cannot read property 'style' of undefined 原因:table 中定义的列和aoColumns ...
- JS报错:Uncaught TypeError: Cannot set property ‘nTf‘ of undefined
在使用DataTable时,遇到以下报错: Uncaught TypeError: Cannot set property 'nTf' of undefined ... ... 初步排查后发现是< ...
- 解决discuz与jquery不兼容问题——下拉列表不能用(Uncaught TypeError: Cannot set property 'position' of undefined)
问题描述: 最近学着用discuz来模仿一个门户网站,里面要把导航条做出滑动效果,要用到jquery,将要用到jquery引用到header.htm中,如下图所示: 但是由于discuz采用php以及 ...
- easyui Datagrid查询报错Uncaught TypeError:Cannot read property 'length' of undefined
1.问题描述 easyui中datagrid执行loadData方法出现如下异常:Cannot read property 'length' of undefined 2.一开始怀疑是js或者页面的问 ...
- 报错: Uncaught TypeError: Cannot read property 'prototype' of undefined(Day_43)
报错原因 引入的js顺序错误,elementUI需要依赖于Vue,调整顺序即可. 调整后
- jquery.dataTables.min.js: Uncaught TypeError: Cannot read property 'style' of undefined
原因:datatable表格内容有操作列,而表头没有定义操作列 少写了一行:<th>操作</th>
- Datatable报错Uncaught TypeError: Cannot read property 'cell' of undefined
使用Datatables时,报出错误 仔细想想,是因为我在columns里加入了id,并设置visible:false 但是却没在下面的HTML部分多加一个 th 虽然我觉得因为id是隐藏的,不用加上 ...
- Vue 组件封装发布到npm 报错 Uncaught TypeError: Cannot read property 'toLowerCase' of undefined
Uncaught TypeError: Cannot read property 'toLowerCase' of undefined 原因是 没有导出 export default { name:& ...
随机推荐
- bzoj1420/1319 Discrete Root
传送门:http://www.lydsy.com/JudgeOnline/problem.php?id=1420 http://www.lydsy.com/JudgeOnline/problem.ph ...
- bzoj 2662&bzoj 2763 SPFA变形
我们用dis[i,j]代表到i这个点,用j张票的最短路程,那么我们只需要在SPFA更新 的时候,用dis[i,j]更新dis[p,j]和dis[p,j+1]就行了 /***************** ...
- Freewheel Tech interview
1.聊背景.. 2.聊项目..然饿我的项目是webvr..基本面试官很少会了解这个..应该再多做实习多做些项目.. 3.浏览器输入网址后到页面呈现出来的过程 4.缓存机制, 浏览器如何判断一个图片有没 ...
- C++学习笔记之——内联函数,引用
本文为原创作品,转载请注明出处 欢迎关注我的博客:http://blog.csdn.net/hit2015spring和http://www.cnblogs.com/xujianqing/ 作者:晨凫 ...
- The Clean Architecture--一篇很不错的关于架构的文章
翻译水平有限,见谅! Uncle Bob 13 Aug 2012 Architecture Craftsmanship Over the last several years we’ve seen a ...
- Tarjan 联通图 Kuangbin 带你飞 联通图题目及部分联通图题目
Tarjan算法就不说了 想学看这 https://www.byvoid.com/blog/scc-tarjan/ https://www.byvoid.com/blog/biconnect/ 下面是 ...
- npm编译报错,缺少组件
解决方式: 1.删除安装文件 node_modules: 2.在需要安装 node_modules 文件的文件夹中,打开命令窗口,输入: cnpm install: 3.再输入: npm start, ...
- opencv第四章
1.载入一个带有有趣纹理的图像,使用cvSmooth()函数以多种方法平滑图像,参数为smoothtype = CV_GAUSSIAN. a.使用对称的平滑的平滑窗口,大小依次是3x3,5x5,9x9 ...
- hdu 1410(直线与矩形相交)
Intersection Time Limit: 1000MS Memory Limit: 10000K Total Submissions: 13528 Accepted: 3521 Des ...
- IP自动切换脚本
@echo off & cls & color 47 & mode con cols=80 lines=25 & title [IP自动切换工具]clsecho. ec ...