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: $ ...
随机推荐
- 疑难杂症rendering(对角线上的线)
postprocess全屏特效 对角线有条线 明显和buffer有关因为线由小的东西组成 就像之前没清空buffer产生的马赛克 beginscene时 clearmask 设0 ---------- ...
- Redis杂记
参考资料: Redis 教程 | 菜鸟教程 : http://www.runoob.com/redis/redis-tutorial.html Redis快速入门 :http://www.yiibai ...
- 比较IE6的不同之处,与IE8 IE11 比较
文档申明为 <!DOCTYPE html> IE6或者IE特有的一些东西 1.盒子模型 IE6:(使用 !DOCTYPE 声明指定 standards-compliant 模式) mar ...
- httpClient多线程请求
使用httpClient可模拟请求Url获取资源,使用单线程的请求速度上会有一定的限制,参考了Apache给出的例子,自己做了测试实现多线程并发请求,以下代码需要HttpClient 4.2的包,可以 ...
- super用法
Person类: public class Person { String _name; int _age; public Person(String name,int age) { _name= n ...
- 从xml文件中读取注释
void Main() { string dirp=@"E:\Cread\UP4201308.bak\UP4.BAK\ExportPath\ConfigFile\"; ...
- .htaccess文件的作用(访问控制)
在线工具: http://www.htaccesseditor.com/sc.shtml 说到.htaccess文件,我想对于wordpress新手或者老手都应该不是很熟悉,也没有多少这方面的概念吧, ...
- (转)Android之ListView原理学习与优化总结
转自: http://jishu.zol.com.cn/12893.html 在整理前几篇文章的时候有朋友提出写一下ListView的性能优化方面的东西,这个问题也是小马在面试过程中被别人问到的….. ...
- C# Socket 入门2(转)
现在来传一个图片看看, 改改程序, 看看服务端 图片为 140K, 1.jgp 1. 服务端 1 using System; 2 using System.Collections.Generic; ...
- 欧拉工程第51题:Prime digit replacements
题目链接 题目: 通过置换*3的第一位得到的9个数中,有六个是质数:13,23,43,53,73和83. 通过用同样的数字置换56**3的第三位和第四位,这个五位数是第一个能够得到七个质数的数字,得到 ...