简体   繁体   中英

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.

My first option was to use indexedDB but then I realised that not all browsers and devices support it.

So, after some research I decided to move to 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:

SCRIPT5007: Unable to get value of the property 'XMLDocument': object is null or undefined.

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 .

I'm downloading the following modules: 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. See more detail on UserData and XMLDocument .

IE9 should use WebStorage (localStorage) instead. Also try out with IE6 or IE7. You will get better picture.

So somewhere mechanisms detection is screwed up. If you have more detail info, I could help out.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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