I'm using jQuery 1.3.2 and Google Chrome 4.0.221.6 - The issue I'm
having is trying to load an xml file, that is nested inside the Chrome
Extension. I realize that the xml file is local and typically you
cannot access local files through javascript. However, when using
files through Chrome Extensions, the file is not accessed with
"file:///", but rather "chrome-extension://<app key>/
filename.fileext". Javascript seems to recognize this as a url and
happily sends it to the browser, where chrome fetches the file.
However, when using these files with jQuery's Ajax commands, it fails.

Note: It doesn't fail like a normal "local file access denied"
Javascript error, it simply fails and just says "error". Is there a
way around this?
Thanks!

Here is some example code to represent the problem:

$(function(){
                        var xmlURL = chrome.extension.getURL("markups.xml");
                        $.ajax({
                                type: "GET",
                                url: xmlURL,
                                dataType: "xml",
                                success: function(xml){
                                     //do stuff
                                },
                                error: function(xml, message, object){
                                        console.log(message); //produces "error"
                                }
                        });
});

Reply via email to