Yes, it seems to be an issue with jQuery's ajax calls. If I substitute their
stuff out for a simple synchronous GET call the code works:

      var req = new XMLHttpRequest();
      req.open('GET', file, false);
      req.send(null);
      req.responseText;

Has anyone had luck using jQuery to access chrome-extension or file urls?

--Jon

On Tue, Dec 15, 2009 at 5:04 PM, Marcos Aruj <marcos.a...@gmail.com> wrote:

> I also had this problem using jQuery. I read some discussions saying that
> if the file is not served by a http server(file:/// for example), then
> there's no status set (0). For jQuery for example, i get the responseText of
> the file correctly, but the status is 0. So many plugins and other stuff act
> as this is a failure, even if the content was correctly pulled.
>
> Would be nice if chrome returns a status for chrome-extension:// request or
> any internal ajax requests. Wyt?
>
> On Tue, Dec 15, 2009 at 3:09 PM, Aaron Boodman <a...@google.com> wrote:
>
>> I wonder if there is an embedded null. Do you mind sharing the file?
>>
>> - a
>>
>> On Tue, Dec 15, 2009 at 12:54 PM, Jon Stritar <jstri...@gmail.com> wrote:
>> > I'm trying to use a library that dynamically loads JSON files via
>> > XMLHttpRequests. I'm hosting the files locally in the extension so
>> > they're accessible via the chrome-extension URL. I'm using the
>> > complete chrome-extension URL in the request (and if I paste it
>> > directly into the browser it downloads the json file).
>> >
>> > The XMLHtttpRequest in the library keeps failing with the following
>> > parameters (when the error callback is called):
>> >
>> >   readyState: 4
>> >   responseText: this has the 2.5 lines of the file
>> >   status: 0
>> >   statusText: blank
>> >
>> > I can't find any other error messages. Any ideas? Why would only 2.5
>> > out of 54 lines be in the responseText? The responseText stops half
>> > way through a string (no unusual characters there) and the JSON is
>> > valid. Do I need to add permissions for this?
>> >
>> > (On Linux build 4.0.270.0)
>> >
>> > Thanks
>> > --Jon
>> >
>> > --
>> >
>> > You received this message because you are subscribed to the Google
>> Groups "Chromium-extensions" group.
>> > To post to this group, send email to
>> chromium-extensi...@googlegroups.com.
>> > To unsubscribe from this group, send email to
>> chromium-extensions+unsubscr...@googlegroups.com<chromium-extensions%2bunsubscr...@googlegroups.com>
>> .
>> > For more options, visit this group at
>> http://groups.google.com/group/chromium-extensions?hl=en.
>> >
>> >
>> >
>>
>> --
>>
>> You received this message because you are subscribed to the Google Groups
>> "Chromium-extensions" group.
>> To post to this group, send email to chromium-extensions@googlegroups.com
>> .
>> To unsubscribe from this group, send email to
>> chromium-extensions+unsubscr...@googlegroups.com<chromium-extensions%2bunsubscr...@googlegroups.com>
>> .
>> For more options, visit this group at
>> http://groups.google.com/group/chromium-extensions?hl=en.
>>
>>
>>
>
>
> --
> Marcos Aruj Alvarez
> Ingeniero de Software
> -------------------------------
> marcos.a...@gmail.com
> -----
>

--

You received this message because you are subscribed to the Google Groups 
"Chromium-extensions" group.
To post to this group, send email to chromium-extensi...@googlegroups.com.
To unsubscribe from this group, send email to 
chromium-extensions+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/chromium-extensions?hl=en.


Reply via email to