d is undefined错误
如图这样的错误:TypeError : d is undefined,今天早上在写代码的时候也是遇见这样的错误,报告的错误是jquery.js中错误,但是这样的问题经常是由于什么名字不对(个人见解),我的就是在写js代码时候,定义页面变量时候出错,就是页面定义和自己的全局变量或者是和自己的页面下面的一些变量不一致的,都会导致这样的问题!比如:下面的一段代码: 如果把第二段js代码中的personalData改成其他的定义,就会出现如此的错误。当然可能还有其他可能的原因会导致这样的错误。
<script>
var config_personalData = {
ct : true
}
</script>
<script>
var page_personalData = {
init :function() {
$.jsonp({
url : 'json/personalData.json',
callback : 'callback',
data : {
imei : GLOBAL.imei,
},
complete :function () {
$MsgBox.hideLoading();
},
success :function (data) {
if(data && data.result && data.success) {
var rows = data.result.rows;
if(rows && rows.length > 0) {
var html='';
for(var i = 0;i < rows.length; i++) {
html += '<img class="userHead" src="'+ rows[i].userHead +'"/>' +
'<div class="userMessage">' + '<div class="NAME">' +
'<div class="name">' + "姓 名:" + '</div>' +
'<div class="Name">'+rows[i].name + '</div>' + '</div>' +
'<div class="SEX">' +
'<div class="sex">' +"性 别:" + '</div>' +
'<div class="Sex">'+ rows[i].sex+ '</div>' + '</div>' +
'<div class="AGE">' +
'<div class="age">' +"年 龄:"+ '</div>' +
'<div class="Age">'+ rows[i].age + '</div>' + '</div>' +
'<div class="STATUS">' +
'<div class="status">' +"状 态:"+ '</div>' +
'<div class="Status">'+ rows[i].status + '</div>' + '</div>' +
'</div>';
}
$('#page_personalData .content').html(html);
}
}
}
});
},
show : function() {
if(!$('#page_personalData .content').html());
if(config_personalData.ct) {
config_personalData.ct = false;
}
},
beforeshow :function () {
$InterAction.setHeader("个人资料","back","refresh");
}
}
$('#page_personalData').live('pageinit', page_personalData.init)
.live('pagebeforeshow', page_personalData.beforeshow)
.live('pageshow', page_personalData.show);
</script>
d is undefined错误的更多相关文章
- [转载][jQuery] Cannot read property ‘msie’ of undefined错误的解决方法
参考 [jQuery] Cannot read property ‘msie’ of undefined错误的解决方法 ---------------------------------------- ...
- [jQuery1.9]Cannot read property ‘msie’ of undefined错误的解决方法
原文:[jQuery1.9]Cannot read property 'msie' of undefined错误的解决方法 $.browser在jQuery1.9里被删除了,所以项目的js代码里用到$ ...
- [jQuery] Cannot read property ‘msie’ of undefined错误的解决方法 --转
初用Yii的srbac模块.出现 Cannot read property ‘msie’ of undefined 错误.上网查询,找到如下的文章.使用文末的打补丁的方法,成功搞定.感谢. ===== ...
- npm ERR! Cannot read property 'match' of undefined 错误处理
跟往常一样运行npm install 的时候,突然报错.错误情况如下: npm ERR! Cannot read property 'match' of undefined npm ERR! A co ...
- MVC4使用SignalR出现$.connection is undefined错误备忘
SignalR使用过程中一定要注意js的引用顺序,否则就会出现$.connection is undefined脚本错误.
- [jQuery] Cannot read property ‘msie’ of undefined错误的解决方法
最近把一个项目的jQuery升级到最新版,发现有些页面报错Cannot read property ‘msie’ of undefined.上jQuery网站上搜了一下,原因是$.browser这个a ...
- jquery升级到新版本报错[jQuery] Cannot read property ‘msie’ of undefined错误的解决方法(转)
最近把一个项目的jQuery升级到最新版,发现有些页面报错Cannot read property 'msie' of undefined.上jQuery网站上搜了一下,原因是$.browser这个a ...
- 关于百度地图(离线)使用过程报“Cannot read property 'jb' of undefined ”错误的解决办法
使用百度地图(离线)API时,地图无法显示,f12查看报错: BaiduApi_2.0.js:1056 Uncaught TypeError: Cannot read property 'jb' of ...
- [转]ztree出现$.fn.zTree is undefined错误的解决办法。
原文地址:https://blog.csdn.net/smallboy2011/article/details/20554269 问题描述,在一个界面使用ztree创建树,提示TypeError: $ ...
随机推荐
- 【翻译】Sencha Touch2.4 The Layout System 布局
[翻译]The Layout System 布局 In Sencha Touch there are two basic building blocks: componentsand containe ...
- Docker学习资料
官方Docker:https://www.docker.com/ CSDN Docker : http://docker.csdn.net/ Docker中文社区:http://www.docker. ...
- 移动MM failed to find resource file{mmiap.xml}
原地址:http://blog.csdn.net/alking_sun/article/details/36175861 在进行移动MM集成的时候总是会遇到一个bug: failed to find ...
- Sqli-labs less 46
Less-46 从本关开始,我们开始学习order by 相关注入的知识. 本关的sql语句为$sql = "SELECT * FROM users ORDER BY $id"; ...
- 【中国互联网不眠夜】Struts2漏洞百出,OneRASP鼎力相助
Struts2是一款优秀的网站框架,在互联网上有十分广泛的应用,近期apache官方发布了高危漏洞通告Apache Struts 任意代码执行漏洞(CVE-2016-3081,S2-032),该漏洞风 ...
- URAL 1517 Freedom of Choice(后缀数组,最长公共字串)
题目 输出最长公共字串 #define maxn 200010 int wa[maxn],wb[maxn],wv[maxn],ws[maxn]; int cmp(int *r,int a,int b, ...
- SPL学习 迭代器
主要学习内容: 慕课网的spl视频教程 阮一峰SPL学习笔记 http://www.ruanyifeng.com/blog/2008/07/php_spl_notes.html SPL类详解 http ...
- Linux zip解压/压缩并指定目录
方法如下: 压缩并指定目录举例:zip -r /home/kms/kms.zip /home/kms/server/kms 解压并指定目录 举例:unzip /home/kms/kms.zip -d ...
- 李洪强iOS经典面试题12
1.说说响应链 答: 事件响应链.包括点击事件,画面刷新事件等.在视图栈内从上至下,或者从下之上传播. 可以说点事件的分发,传递以及处理.具体可以去看下touch事件这块.因为问的太抽象化了 严重怀 ...
- socket异步编程--libevent的使用
使用 libevent 和 libev 提高网络应用性能 http://www.ibm.com/developerworks/cn/aix/library/au-libev/ libevent实现ht ...