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: $ ...
随机推荐
- Linux安装Flash player
在线自动更新:Flash Player Update(需java) ===================== 下载得到install_flash_player_11_linux.x86_64.tar ...
- 2014_GCJ_A
题目链接:http://code.google.com/codejam/contest/2984486/dashboard#s=p0 最想吐槽的是想些DFS过小数据,居然写不出来,不知道我这半年的AC ...
- ASP.NET用户控件事件的定义和实践
假定用户控件(UserControl.ascx)中包含按钮控件 AButton,希望实现按 Button 按钮时,包含该用户控件的页面可以接收到事件. UserControl.ascx.cs ...
- 在JavaScript中判断整型的N种方法
原文:http://www.cnblogs.com/YcYYcY/p/3759184.html 整数类型(Integer)在JavaScript经常会导致一些奇怪的问题.在ECMAScript的规范中 ...
- eclipse编译项目jar,git管理代码
2015-3-10 settings.xml文件: <localRepository>C:\Users\xxx\.m2\repository</localRepository> ...
- mysql存储过程和事件
1.会员表member和车辆表car,更新每个会员下面的车辆数量have_car字段. DELIMITER $$ USE $$ DROP PROCEDURE IF EXISTS `sp_update_ ...
- awk处理之案例一:awk 处理百分比的问题
编译环境 本系列文章所提供的算法均在以下环境下编译通过. [脚本编译环境]Federa 8,linux 2.6.35.6-45.fc14.i686 [处理器] Intel(R) Core(TM)2 Q ...
- Leetcode: strStr()
Implement strStr(). Returns the index of the first occurrence of needle in haystack, or -1 if needle ...
- ExtJs之Ext.util.Format
<!DOCTYPE html> <html> <head> <title>ExtJs</title> <meta http-equiv ...
- java中String,StringBuffer,StringBuilder之间的区别
文章转载自:http://www.cnblogs.com/frankliiu-java/archive/2010/07/05/1771537.html String是固定长度的字符串,如果要发生变化必 ...