如图这样的错误: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错误的更多相关文章

  1. [转载][jQuery] Cannot read property ‘msie’ of undefined错误的解决方法

    参考 [jQuery] Cannot read property ‘msie’ of undefined错误的解决方法 ---------------------------------------- ...

  2. [jQuery1.9]Cannot read property ‘msie’ of undefined错误的解决方法

    原文:[jQuery1.9]Cannot read property 'msie' of undefined错误的解决方法 $.browser在jQuery1.9里被删除了,所以项目的js代码里用到$ ...

  3. [jQuery] Cannot read property ‘msie’ of undefined错误的解决方法 --转

    初用Yii的srbac模块.出现 Cannot read property ‘msie’ of undefined 错误.上网查询,找到如下的文章.使用文末的打补丁的方法,成功搞定.感谢. ===== ...

  4. npm ERR! Cannot read property 'match' of undefined 错误处理

    跟往常一样运行npm install 的时候,突然报错.错误情况如下: npm ERR! Cannot read property 'match' of undefined npm ERR! A co ...

  5. MVC4使用SignalR出现$.connection is undefined错误备忘

    SignalR使用过程中一定要注意js的引用顺序,否则就会出现$.connection is undefined脚本错误.

  6. [jQuery] Cannot read property ‘msie’ of undefined错误的解决方法

    最近把一个项目的jQuery升级到最新版,发现有些页面报错Cannot read property ‘msie’ of undefined.上jQuery网站上搜了一下,原因是$.browser这个a ...

  7. jquery升级到新版本报错[jQuery] Cannot read property ‘msie’ of undefined错误的解决方法(转)

    最近把一个项目的jQuery升级到最新版,发现有些页面报错Cannot read property 'msie' of undefined.上jQuery网站上搜了一下,原因是$.browser这个a ...

  8. 关于百度地图(离线)使用过程报“Cannot read property 'jb' of undefined ”错误的解决办法

    使用百度地图(离线)API时,地图无法显示,f12查看报错: BaiduApi_2.0.js:1056 Uncaught TypeError: Cannot read property 'jb' of ...

  9. [转]ztree出现$.fn.zTree is undefined错误的解决办法。

    原文地址:https://blog.csdn.net/smallboy2011/article/details/20554269 问题描述,在一个界面使用ztree创建树,提示TypeError: $ ...

随机推荐

  1. javascript中继承(一)-----原型链继承的个人理解

    [寒暄]好久没有更新博客了,说来话长,因为我下定决心要从一个后台程序员转为Front End,其间走过了一段漫长而艰辛的时光,今天跟大家分享下自己对javascript中原型链继承的理解. 总的说来, ...

  2. Swift-2-基本操作符

    // Playground - noun: a place where people can play import UIKit // 基本运算符 // 运算符有3种: 单目运算符(如 -a),二目运 ...

  3. VS开发工具 不会在异常的地方停止的问题.

    启用"仅我的代码"

  4. ActionScript基本语法讲解

    var a:int = 3;var b:int = 4; b = 9; trace ("a的值为:"+a);trace ("b的值为:"+b); var x1: ...

  5. 用include来处理模板的问题

    /** * 测试方法 */ protected function getHtml() { $tpl = $this->pageletDir.$this->plTemplate; $html ...

  6. Maven在项目中的应用

    http://192.168.0.253:8081/nexus/#view-repositories;thirdparty~uploadPanel 使用局域网搭建的环境,输入用户名和密码登录,上传ja ...

  7. Sqli-labs less 39

    Less-39 和less-38的区别在于sql语句的不一样:SELECT * FROM users WHERE id=$id LIMIT 0,1 也就是数字型注入,我们可以构造以下的payload: ...

  8. list<T> 自定义比较器进行排序

    今天在研究List<T> 集合如何排序,我试过很多,但是都不行,然后看到msdn中的这个比较器排序,自己测试了代码,No Problem.给大家分享一下. 类型 T 的默认比较器按如下方式 ...

  9. POJ 2101

    #include <iostream> #include <algorithm> #include <cmath> using namespace std; int ...

  10. Java IO(二)

    字节流 字符流: FileReader FileWriter BufferedReader BufferedWriter 字节流: FileInputStream FileOutputStream B ...