IndexedDBShim.js error : JavaScript runtime error: Assignment to read-only properties is not allowed in strict mode

790 views Asked by At

I am experimenting with IndexedDB jquery API as indexedDB isnt compatible with safari / ipad. Ive just started using it and got this error when only running HTML and im not able to use anything in the files. The files im refering to are IndexedDBShim

my html looks like

    <!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <title></title>
    <script src="JavaScript1.js" type="text/javascript"></script>

    <script src="/Scripts/IndexedDBShim.js" type="text/javascript"></script>
    <script src="/Scripts/IndexedDBShim.min.js" type="text/javascript"></script>
    <script src="/Scripts/jquery.indexeddb.js" type="text/javascript"></script>
    <script src="/Scripts/jquery.indexeddb.min.js" type="text/javascript"></script>
</head>
<body>
    <button onclick="test()">CREATE DATABASE</button>
</body>
</html>

And there is nothing in the Test() function. The error im getting is: 0x800a13b5 - JavaScript runtime error: Assignment to read-only properties is not allowed in strict mode on line 1653 at window.indexedDB = window.indexedDB || window.webkitIndexedDB || window.mozIndexedDB || window.oIndexedDB || window.msIndexedDB;

Am i using this wrong?

Thank you

1

There are 1 answers

0
Deni Spasovski On

You don't need to use the line anymore:

window.indexedDB = window.indexedDB || window.webkitIndexedDB || window.mozIndexedDB || window.oIndexedDB || window.msIndexedDB;

In all browsers the keyword indexedDB is now a standard http://caniuse.com/#search=IndexedDB.