I have a web page with some JS scripts that needs to work locally, e.g. from hard disk or a CD-ROM. The scripts load JSON data from files by inserting <script>
tags. This worked fine in IE6, but now in IE8 it takes an enormous amount of time: it went from "instantly" to 3-10 seconds. The main data file is 45KB large.
How can I solve this? I would switch from <script>
tags to another method of loading JSON (ideally involving the new native JSON parser), but it seems locally loaded content cannot access the XMLHttpRequest object. Any ideas?
Update
I found out that the new native XHR object in IE does not allow file:// access, but the ActiveX version still does. So I am now able to get the JSON data. Parsing it with JSON.parse
or even eval
, however, takes even more time than <script>
elements. Now what?