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: $ ...
随机推荐
- [百度空间] [转]程序员趣味读物:谈谈Unicode编码
出处:CSDN [ 2005-05-13 10:05:53 ] 作者:fmddlmyy 这是一篇程序员写给程序员的趣味读物.所谓趣味是指可以比较轻松地了解一些原来不清楚的概念,增进知识,类似于打RPG ...
- css属性简写集合
作为一个前端攻城狮,CSS那绝对是基础,可是基础也有掌握不牢的时候.今天就来总结一下容易写错的CSS属性简写问题. 1.background 背景颜色:background-color ...
- AC 自动机在这里
HDU 3065,模板(备忘录) #include<stdio.h> #include<string.h> #include<math.h> #include< ...
- 使用CSS3实现超炫的Loading(加载)动画效果
SpinKit 是一套网页动画效果,包含8种基于 CSS3 实现的很炫的加载动画.借助 CSS3 Animation 的强大功能来创建平滑,易于定制的动画.SpinKit 的目标不是提供一个每个浏览器 ...
- Sqli-labs less 40
Less-40 本关的sql语句为SELECT * FROM users WHERE id=('$id') LIMIT 0,1 我们根据sql语句构造以下的payload: http://127.0. ...
- 如何使用CSS3创建一个漂亮的图标
演示 下载 今天,我想展示给你一个巧妙的花招.我们将创建一个纯CSS3文本图标.更让人震惊的是,这效果将只需要一个HTML元素. 游戏的计划 创建一个矩形盒子 设置圆角 使用伪类元素创建一个卷角效果 ...
- 运行时修改TimerTask的执行周期
java.util.TimerTask类的执行周期period变量的声明如下: /** * Period in milliseconds for repeating tasks. A positive ...
- (转) C++ static、const和static const 以及它们的初始化
const定义的常量在超出其作用域之后其空间会被释放,而static定义的静态常量在函数执行后不会释放其存储空间. static表示的是静态的.类的静态成员函数.静态成员变量是和类相关的,而不是和类的 ...
- iOS应用间的跳转和传值
在第一个应用程序中info.plist设置 URL Identifier: 该字符串是你自定义的 URL scheme 的名字 注意: URL Schemes 是一个数组,允许应用定义多个 URL s ...
- UITbaleView上按钮的单选
设置Id属性,标记是哪个cell @property (nonatomic,assign)NSInteger Id; 设置一个普通状态和选中状态图片不同的按钮 _choose = [[UIButton ...