<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Ajax calls not reporting correct status in Android App Preview in Software Archive</title>
    <link>https://community.intel.com/t5/Software-Archive/Ajax-calls-not-reporting-correct-status-in-Android-App-Preview/m-p/1039920#M45599</link>
    <description>&lt;P&gt;There seems to be a weird bug that only occurs in app preview on Android.&lt;/P&gt;

&lt;P&gt;I make an Ajax call to a page that returns a HTTP 403 response, but the status code in the JQuery Ajax callback is 200.&lt;/P&gt;

&lt;P&gt;To be clear, this only happens on App Preview for Android. &amp;nbsp;The same code runs correctly on the Emulator, on App Preview for iOS, and in full builds for both Android and iOS.&lt;/P&gt;

&lt;P&gt;Here is some example code:&lt;/P&gt;

&lt;PRE class="brush:jscript;"&gt;                $.ajax({
                    type: "GET",
                    url: "http://myserver/mypage", 
                    success: function (result) {
                        // This callback always executes on App Preview for Android regardless of status code
                        
                    },
                    error: function (xhr, status, err) {
                       
                        if (xhr.status == 401 || xhr.status == 403) {
                            // this callback never executes on App Preview for Android
                            app.consoleLog("Access Forbidden");
                        }
                    }
                });&lt;/PRE&gt;

&lt;P&gt;The bizzarre thing is, looking in the console log, the underlying framework knows it is getting a 403 back because it is logging an error, however the Ajax status code is always 200: "Failed to load resource: the server responded with a status of 403 (Forbidden) "&lt;/P&gt;

&lt;P&gt;&amp;nbsp;&lt;/P&gt;

&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Fri, 24 Apr 2015 10:40:25 GMT</pubDate>
    <dc:creator>Mark_B_3</dc:creator>
    <dc:date>2015-04-24T10:40:25Z</dc:date>
    <item>
      <title>Ajax calls not reporting correct status in Android App Preview</title>
      <link>https://community.intel.com/t5/Software-Archive/Ajax-calls-not-reporting-correct-status-in-Android-App-Preview/m-p/1039920#M45599</link>
      <description>&lt;P&gt;There seems to be a weird bug that only occurs in app preview on Android.&lt;/P&gt;

&lt;P&gt;I make an Ajax call to a page that returns a HTTP 403 response, but the status code in the JQuery Ajax callback is 200.&lt;/P&gt;

&lt;P&gt;To be clear, this only happens on App Preview for Android. &amp;nbsp;The same code runs correctly on the Emulator, on App Preview for iOS, and in full builds for both Android and iOS.&lt;/P&gt;

&lt;P&gt;Here is some example code:&lt;/P&gt;

&lt;PRE class="brush:jscript;"&gt;                $.ajax({
                    type: "GET",
                    url: "http://myserver/mypage", 
                    success: function (result) {
                        // This callback always executes on App Preview for Android regardless of status code
                        
                    },
                    error: function (xhr, status, err) {
                       
                        if (xhr.status == 401 || xhr.status == 403) {
                            // this callback never executes on App Preview for Android
                            app.consoleLog("Access Forbidden");
                        }
                    }
                });&lt;/PRE&gt;

&lt;P&gt;The bizzarre thing is, looking in the console log, the underlying framework knows it is getting a 403 back because it is logging an error, however the Ajax status code is always 200: "Failed to load resource: the server responded with a status of 403 (Forbidden) "&lt;/P&gt;

&lt;P&gt;&amp;nbsp;&lt;/P&gt;

&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 24 Apr 2015 10:40:25 GMT</pubDate>
      <guid>https://community.intel.com/t5/Software-Archive/Ajax-calls-not-reporting-correct-status-in-Android-App-Preview/m-p/1039920#M45599</guid>
      <dc:creator>Mark_B_3</dc:creator>
      <dc:date>2015-04-24T10:40:25Z</dc:date>
    </item>
    <item>
      <title>hmm... This is interesting.</title>
      <link>https://community.intel.com/t5/Software-Archive/Ajax-calls-not-reporting-correct-status-in-Android-App-Preview/m-p/1039921#M45600</link>
      <description>&lt;P&gt;hmm... This is interesting. So, are you able to get through the request? What is the response text?&amp;nbsp;&lt;/P&gt;

&lt;P&gt;Swati&lt;/P&gt;</description>
      <pubDate>Fri, 24 Apr 2015 20:00:17 GMT</pubDate>
      <guid>https://community.intel.com/t5/Software-Archive/Ajax-calls-not-reporting-correct-status-in-Android-App-Preview/m-p/1039921#M45600</guid>
      <dc:creator>Swati_S_Intel1</dc:creator>
      <dc:date>2015-04-24T20:00:17Z</dc:date>
    </item>
    <item>
      <title>Hi Swati,</title>
      <link>https://community.intel.com/t5/Software-Archive/Ajax-calls-not-reporting-correct-status-in-Android-App-Preview/m-p/1039922#M45601</link>
      <description>&lt;P&gt;Hi Swati,&lt;/P&gt;

&lt;P&gt;I checked this out for you.&amp;nbsp;&lt;/P&gt;

&lt;P&gt;The JQuery responseText is "You do not have permission to view this directory or page". &amp;nbsp;But the JQuery status field is 200, and statusText field is "OK".&lt;/P&gt;

&lt;P&gt;And just to reiterate what I said in the first post, the underlying framework knows it is getting a 403 response because it also logs to the console "&lt;SPAN style="font-size: 12px; line-height: 16.3636360168457px;"&gt;Failed to load resource: the server responded with a status of 403 (Forbidden)&lt;/SPAN&gt;". Something in App Preview that sits between that console log happening and the Ajax callback firing seems to be tampering with the status code I get?&lt;/P&gt;

&lt;P&gt;Mark.&lt;/P&gt;</description>
      <pubDate>Mon, 27 Apr 2015 15:40:29 GMT</pubDate>
      <guid>https://community.intel.com/t5/Software-Archive/Ajax-calls-not-reporting-correct-status-in-Android-App-Preview/m-p/1039922#M45601</guid>
      <dc:creator>Mark_B_3</dc:creator>
      <dc:date>2015-04-27T15:40:29Z</dc:date>
    </item>
    <item>
      <title>Hi Mark,</title>
      <link>https://community.intel.com/t5/Software-Archive/Ajax-calls-not-reporting-correct-status-in-Android-App-Preview/m-p/1039923#M45602</link>
      <description>&lt;P&gt;Hi Mark,&lt;/P&gt;

&lt;P&gt;Thanks for your input. Can you share your working code that accesses the site and gets 403? I would like to debug some more. Also, which android version are you running? And I assume you are using the latest version of App Preview (2.3).&lt;/P&gt;

&lt;P&gt;Swati&lt;/P&gt;</description>
      <pubDate>Tue, 28 Apr 2015 21:47:28 GMT</pubDate>
      <guid>https://community.intel.com/t5/Software-Archive/Ajax-calls-not-reporting-correct-status-in-Android-App-Preview/m-p/1039923#M45602</guid>
      <dc:creator>Swati_S_Intel1</dc:creator>
      <dc:date>2015-04-28T21:47:28Z</dc:date>
    </item>
    <item>
      <title>Any update on this, I'm</title>
      <link>https://community.intel.com/t5/Software-Archive/Ajax-calls-not-reporting-correct-status-in-Android-App-Preview/m-p/1039924#M45603</link>
      <description>&lt;P&gt;Any update on this, I'm getting the same issue using Angular JS $http calls&lt;/P&gt;</description>
      <pubDate>Fri, 03 Jun 2016 13:01:18 GMT</pubDate>
      <guid>https://community.intel.com/t5/Software-Archive/Ajax-calls-not-reporting-correct-status-in-Android-App-Preview/m-p/1039924#M45603</guid>
      <dc:creator>Mark_F_</dc:creator>
      <dc:date>2016-06-03T13:01:18Z</dc:date>
    </item>
    <item>
      <title>See this sticky note &gt; https:</title>
      <link>https://community.intel.com/t5/Software-Archive/Ajax-calls-not-reporting-correct-status-in-Android-App-Preview/m-p/1039925#M45604</link>
      <description>&lt;P&gt;See this sticky note &amp;gt; &lt;A href="https://software.intel.com/en-us/forums/intel-xdk/topic/635053" target="_blank"&gt;https://software.intel.com/en-us/forums/intel-xdk/topic/635053&lt;/A&gt; &amp;lt;&lt;/P&gt;</description>
      <pubDate>Fri, 03 Jun 2016 20:50:55 GMT</pubDate>
      <guid>https://community.intel.com/t5/Software-Archive/Ajax-calls-not-reporting-correct-status-in-Android-App-Preview/m-p/1039925#M45604</guid>
      <dc:creator>PaulF_IntelCorp</dc:creator>
      <dc:date>2016-06-03T20:50:55Z</dc:date>
    </item>
  </channel>
</rss>

