简体   繁体   English

ydn-db与ie9有关的问题:SCRIPT5007:无法获取属性'XMLDocument'的值:对象为null或未定义

[英]ydn-db issue with ie9: SCRIPT5007: Unable to get value of the property 'XMLDocument': object is null or undefined

I'm using ydn-db to build a test app that can work offline in mutliple borwsers and devices. 我正在使用ydn-db构建可在多用途浏览器和设备中脱机工作的测试应用程序。

My first option was to use indexedDB but then I realised that not all browsers and devices support it. 我的第一个选择是使用indexedDB,但是后来我意识到并不是所有的浏览器和设备都支持它。

So, after some research I decided to move to ydn-db. 因此,经过研究后,我决定移至ydn-db。

I'm initializing the db by doing this: 我正在通过执行以下操作来初始化数据库:

var dbSchema = {
version: DB_VERSION,
//autoSchema: true,
stores: [{
  name: DB_STORE_USERS_NAME,
  autoIncrement: false, // optional.
  indexes: [{
    name: 'login', // optional
    keyPath: 'login',
    unique: true,
    multiEntry: false
  }]
 }, {
  name: DB_STORE_REPOS_NAME,
  autoIncrement: false, // optional.
  indexes: [{
    name: 'userid', // optional
    keyPath: 'owner.id',
    unique: false
  }]
}]
};

db = new ydn.db.Storage(DB_NAME, dbSchema);

This works fine in chrome, but when I test it in ie9 I get the following error: 这在chrome中可以正常工作,但是当我在ie9中对其进行测试时,出现以下错误:

SCRIPT5007: Unable to get value of the property 'XMLDocument': object is null or undefined. SCRIPT5007:无法获取属性“ XMLDocument”的值:对象为null或未定义。

Do you have any clue of what can be the issue here? 您对这里的问题有什么线索吗?

I'm using the last version of ydn-db as it is in the site http://dev.yathit.com/ydn-db/downloads.html . 我正在使用ydn-db的最新版本,因为它在网站http://dev.yathit.com/ydn-db/downloads.html中

I'm downloading the following modules: IndexedDb, WebSql, Webstorage, Userdata, Query 我正在下载以下模块:IndexedDb,WebSql,Webstorage,Userdata,Query

XMLDocument , which is available only in older IE (with compatibility mode in IE9 ?) is used to persist data with UserData storage mechanism on DOM node. XMLDocument仅在较旧的IE(在IE9中具有兼容模式)中可用,用于通过UserData存储机制在DOM节点上持久存储数据。 See more detail on UserData and XMLDocument . 查看有关UserDataXMLDocument的更多详细信息。

IE9 should use WebStorage (localStorage) instead. IE9应该改用WebStorage(localStorage)。 Also try out with IE6 or IE7. 也可以尝试使用IE6或IE7。 You will get better picture. 您将获得更好的画面。

So somewhere mechanisms detection is screwed up. 因此,机制检测就被搞砸了。 If you have more detail info, I could help out. 如果您有更多详细信息,我可以帮您。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM