You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@cordova.apache.org by "Edna Morales (JIRA)" <ji...@apache.org> on 2014/09/25 22:54:36 UTC

[jira] [Comment Edited] (CB-7613) AJAX request causes 404 error on iOS 8.0

    [ https://issues.apache.org/jira/browse/CB-7613?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14148293#comment-14148293 ] 

Edna Morales edited comment on CB-7613 at 9/25/14 8:54 PM:
-----------------------------------------------------------

With my previous test I was creating a file within the application. If I include the file in the www directory of the project I do
{code:title=Bar.javascript|borderStyle=solid}
xmlhttp.open("GET", "text.txt?12345", true);
{code}
and that works correctly for me on both iOS 7 and iOS 8.

If I were to follow something closer to your example where I have a file located at www/app/text2.txt then it should be
{code:borderStyle=solid}
xmlhttp.open("GET", "app/text2.txt?12345", true);
{code}

What file path are you specifying in your request?


was (Author: eymorale):
With my previous test I was creating a file within the application. If I include the file in the www directory of the project I do
{code:title=Bar.javascript|borderStyle=solid}
xmlhttp.open("GET", "text.txt?12345", true);
{code}
and that works correctly for me on both iOS 7 and iOS 8.

If I were to follow something closer to your example where I have a file located at www/app/text2.txt then it should be
{code:title=Bar.javascript|borderStyle=solid}
xmlhttp.open("GET", "app/text2.txt?12345", true);
{code}

What file path are you specifying in your request?

> AJAX request causes 404 error on iOS 8.0
> ----------------------------------------
>
>                 Key: CB-7613
>                 URL: https://issues.apache.org/jira/browse/CB-7613
>             Project: Apache Cordova
>          Issue Type: Sub-task
>    Affects Versions: 3.6.0
>         Environment: Cordova 3.6.3-0.2.13
> iPhone 5: iOS 8.0
>            Reporter: Scott Garland
>
> Making an AJAX request for a local file (www/app/json/Contacts/states.json) works on iOS 7.0 for both the iPhone and iPhone simulator; however, the same request in iOS 8.0 only works on the iPhone simulator. When attempting to request the file on an iPhone 5 running iOS 8.0, the Safari web inspector yields the following error:
> file:///private/var/mobile/Containers/Bundle/Application/3319C2ED-FF2C-4A81-A019-D537B5CF3349/myApp.app/www/app/json/Contacts/states.json?08VC9Hx0vEDUxIj
> Failed to load resource: The requested URL was not found on this server.
> Note: The random string (08VC9Hx0vEDUxIj) appended to the end of the filename exists to prevent caching. It is not clear if this is part of the problem, but if it is, the problem only occurs when the phonegap app is deployed to a real iOS 8.0 device.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)