Problems with jQuery getJSON using local files in Chrome

前端 未结 7 1360
情书的邮戳
情书的邮戳 2020-11-22 16:21

I have a very simple test page that uses XHR requests with jQuery\'s $.getJSON and $.ajax methods. The same page works in some situations and not in others. Specificially,

相关标签:
7条回答
  • 2020-11-22 17:11

    An additional way to get around the problem is by leveraging Flash Player's Local Only security sandbox and ExternalInterface methods. One can have JavaScript request a Flash application published using the Local Only security sandbox to load the file from the hard drive, and Flash can pass the data back to JavaScript via Flash's ExternalInterface class. I've tested this in Chrome, FF and IE9, and it works well. I'd be happy to share the code if anyone is interested.

    EDIT: I've started a google code (ironic?) project for the implementation: http://code.google.com/p/flash-loader/

    0 讨论(0)
提交回复
热议问题