Ticket #10660 (closed bug: wontfix)
no transport error on Windows Phone 7
| Reported by: | mike@… | Owned by: | mike@… |
|---|---|---|---|
| Priority: | low | Milestone: | None |
| Component: | ajax | Version: | 1.6.4 |
| Keywords: | Cc: | jaubourg | |
| Blocking: | Blocked by: |
Description
an ajax request throws a 'no transport' error using PhoneGap and Windows Phone 7. To fix this we need to do a:
$.support.cors = true;
before the request. This might be related to the fact that in this situation:
parent.location.protocol == 'x-wmapp1:'
not file: or local: like on other devices
Change History
comment:2 Changed 19 months ago by mike@…
- Status changed from pending to new
I do agree that it is not a very high priority bug since there is a workaround the user can do, and I agree that Microsoft shouldn't be just making up their own protocol where local: or file: would work fine.
But I do think it should be eventually fixed since it would seem to be a very low risk fix and we gain consistently across all platforms. I have already seen a few posts of people running into this issue.
comment:3 Changed 19 months ago by timmywil
- Cc jaubourg added
- Keywords needsreview added
- Status changed from new to open
- Component changed from unfiled to ajax
- Priority changed from undecided to low
comment:4 Changed 18 months ago by purplecabbage@…
I am dealing with this directly in PhoneGap code for WP7 Mango. The issue is a security access violation when using XHR to local files. The WP7 Silverlight WebBrowser component does not have a domain when running locally, so ALL local XHR requests fail. Not just a jQuery issue.
- Jesse
comment:5 Changed 15 months ago by jaubourg
- Keywords needsreview removed
- Status changed from open to closed
- Resolution set to wontfix
"$.support.cors = true;" is the way to go for now. Mobile browsers move too fast and too ectically for us to handle every single case.
comment:6 Changed 5 weeks ago by anonymous
So do you think one programmer can use this "bug" for gain informations about other sites?
comment:7 Changed 5 weeks ago by Mike
I disagree with closing this issue, we should have confidence that jQuery will work across all devices/browsers. This bug is very easily fixed in the jQuery code, it is a very low risk fix, and we gain consistently across all platforms.
This is not the old windows phone OS, this is the new windows 8 OS
comment:8 Changed 5 weeks ago by anonymous
just one more bit of info, Windows Phone and Windows 8 desktop use 2 different protocols:
parent.location.protocol == 'x-wmapp1:' and parent.location.protocol == 'ms-appx:'
comment:9 Changed 2 weeks ago by MJHeijster
With Windows Phone 8 the thrown error is NetworkError instead of No Transport.
My test code for both WP7 and WP8:
$.ajax("http://localhost:8081/api.html", {
async: false,
contentType: "text/xml",
data: body,
type: "POST",
success: function (data, textStatus, jqXHR) {
console.log("request successful, body: " + data);
//Code that should happen
},
error: function (jqXHR, textStatus, errorThrown) {
console.log(textStatus + ": " + errorThrown);
}
});
Logged in Console: WP7: Log:"error: NetworkError" WP8: Log:"error: NetworkError"
If I put $.support.cors = true; in front of it, it works.
Please follow the bug reporting guidlines and use jsFiddle when providing test cases and demonstrations instead of pasting the code in the ticket.

Since we just shipped 1.7 today we aren't going to be able to do any internal fix for a while, so the cors solution is fine. And I'm not sure that we should. Is the "x-wmapp1" protocol some standard name? If so it sure seems to be randomly chosen.