Re: Chrome ajax request to localhost

1,118 views
Skip to first unread message

tech4computer

unread,
Apr 6, 2010, 1:48:51 AM4/6/10
to Chromium-extensions
the xmlhttrequest.state => 0 indicates response is from local server.
xmlhttrequest.state > 200 means response is from remote server.

On Apr 5, 5:50 am, breedish <breed...@gmail.com> wrote:
> Hi to everybody.
>
> I have a problem, a i'm making a simple extension for our project for
> chrome, to manage(switch) modes of our application.
> So now i have just several links for each mode in popup.html. I make a
> request for a background script to connect to my local applicationhttp://localhost:8080/ams/internal/modes.jsp?par=1&... etc So request
> passes ok. In response i send simple json
> { mode : '1' }. But when i try to get xmlhttprequest responseText it
> always has empty string. And xmlhttrequest.state is always 0.
> I have no problem with other domain.
>
> Is there any restrictions on localhost ?

Amos

unread,
Apr 6, 2010, 9:09:47 AM4/6/10
to Chromium-extensions
Hi breedish,

First, make sure you give your extension the necessary network
permissions in your manifest.json file.
Second, my extension also makes ajax requests to localhost, and I had
some problems with that. If I recall correctly, changing from
localhost to 127.0.0.1 helped.

Hope it works for you.

Amos

Reply all
Reply to author
Forward
Message has been deleted
0 new messages