`
bingo6001
  • 浏览: 10507 次
  • 性别: Icon_minigender_1
  • 来自: 重庆
社区版块
存档分类
最新评论

‘undefined’ is null or not an object

阅读更多
之前引用了网友实现的一个json查询功能,导致今天遇到一个奇怪的问题:
在高版本浏览器(IE10+,FF,CHROME等)表现正常,但是在IE 7,8总是在打开页面的第一时间弹出错误:‘undefined’ is null or not an object
百度、调试了一下午,还是没有找到问题的根源。
后来回想是不是因为我也引入了jquery造成的,果不其然,估计是jsonquery.js和jquery中定义的某个方法冲突了,将他们的顺序调整下,先引入jsonquery.js,再引入jquery,问题解决!(自动屏蔽js功底差)

这次事件让我学会的是,有问题先自查,理清楚问题产生的原因是什么,不要盲目的百度以及查看别人的解决方案。因为很有可能的情况就像这样,看起来问题的现象是一样的,但是原因却有千差万别!

另外:如果有遇到此等问题的同学也可以先看看是不是因为其他JS和jquery冲突了,少走弯路!
0
0
分享到:
评论

相关推荐

    Sortable前端框架

    unwanted touchmove events even when your finger is not moving, resulting in the sort not triggering. This option sets the minimum pointer movement that must occur before the delayed sorting is ...

    not-defined:检查是否未定义foo,即undefined,null,空字符串,数组,对象或NaN

    没有定义的检查是否... is null, undefined, NaN, an empty string, array or object) { // do something, usually throw a TypeError}您还可以使用更简短但仍具有语义的形式,例如import no from 'not-defined'if

    json.js_json2.js

    value any JavaScript value, usually an object or array. replacer an optional parameter that determines how object values are stringified for objects. It can be a function or an array of strings. ...

    Flex编译错误码总结

    1. Error 1009: Cannot access a property or method of a null object reference 这个错误通常发生在尝试访问一个为null的对象的属性或方法时。确保在调用对象的方法或访问其属性之前,该对象已经被正确实例化。 2...

    Google C++ Style Guide(Google C++编程规范)高清PDF

    Another useful rule of thumb: it's typically not cost effective to inline functions with loops or switch statements (unless, in the common case, the loop or switch statement is never executed)....

    10种JavaScript最常见的错误(小结)

    2. TypeError: ‘undefined’ is not an object (Safari) Safari浏览器会显示这个错误,与Chrome的"Cannot read property"类似,表示尝试访问未定义的对象。确保在访问属性或方法前对象已定义。 3. TypeError: ...

    LCTF软件备份VariSpec™ Liquid Crystal Tunable Filters

    Each command is terminated with an end-of-line terminator which can be either a carriage-return <c/r> or line feed <l/f>. For RS-232 models, the baud rate and terminator character are selected using ...

    acpi控制笔记本风扇转速

    Descriptor field names where an "object does not exist" error could be incorrectly generated if the parent ResourceTemplate pathname places the template within a different namespace scope than the ...

    JavaScript in 10 Minutes

    - **Odd Tidbit**: Explains that the `this` keyword is never falsy, meaning it will never evaluate to `false`, `null`, `undefined`, or `0`. #### Gotchas The guide provides warnings about common ...

    weapp.qrcode.js

    // Return undefined instead of __proto__ if '__proto__' is not an own property var getProperty = function getProperty(obj, name) { if (name === '__proto__') { if (!hasOwn.call(obj, name)) { ...

    jQuery 1.6.3正式版发布

    #10076:$.inArray crashes IE6 and Chrome if second argument is `null` or `undefined` CSS #6652:Remove filter:alpha(opacity=100) after animation #9572:Support -ms-transform in .css() method #10021:...

    Android Rreact Native 常见错误总结

    6.react native undefined is not an object (evaluating this.... 这个错误通常是因为我们忘记了 bind(this) 所导致的。在 React 中,如果我们需要在回调函数中使用 this,那么我们需要使用 bind(this) 方法来绑定...

    unigui0.83.5.820

    - 0000712: raise error if Form owner is not either TUniGUIApplication or TApplication - 0000609: TUniTimer: Attach to TUniScreenMask - 0000703: TUniDBLookUpxxx bug when datasource and datafield are ...

    simplewebrtc.js webrtc网页视频开发帮助工具

    throw new Error("Browser does not appear to be WebRTC-capable"); } // emitter that we use as a base function WildEmitter() { this.callbacks = {}; } // Listen on the given `event` with `fn`. ...

    C语言错误解释和总结

    ### C语言错误解释和总结 在C语言编程中,遇到各种各样的编译错误和运行时错误是家常便饭。这些错误不仅包括语法上的不规范,也涵盖了类型不匹配、资源管理不当以及逻辑...- **Value computed is not used**: 计算得到...

    JavaScript语言教程&案例.docx

    console.log("You are not an adult."); } ``` - **循环语句**:重复执行一段代码。 ```javascript for (let i = 0; i ; i++) { console.log(i); } let j = 0; while (j ) { console.log(j); j++; } `...

    c++出错提示英汉对照表

    57. **Object 'xxx' is not a function or function pointer** - 对象'xxx'不是函数或函数指针:尝试像函数一样调用一个非函数对象。检查对象的类型并确保正确使用。 58. **Object 'xxx' is not a variable** - ...

    新浪推荐浮动广告

    <br>var $dom={ parseInt : function(s) { if (s == null || s == '' || typeof(s)=='undefined') return 0; <br> return parseInt(s); }, getClientSize : function(n){ if ($...

Global site tag (gtag.js) - Google Analytics