- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
I was runinng my app and geting some json with ajax but it stop working int the app preview. The code is running fine in the emulator but I can`t figure out what was happened with the app preview.
I update Intel XDK to 2807, but it was working fine. Below you can find the test I'm running.
Thanks in advance for any help.
<!DOCTYPE html> <html> <head> <title>AJAX and XDK</title> <meta name="viewport" content="initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0, user-scalable=0;" /> <script type="text/javascript" charset="utf-8" src="http://code.jquery.com/jquery-2.0.3.min.js"></script> <script> function doJSON1() { $.getJSON('http://www.w3schools.com/website/customers_mysql.php', function (data) { alert(JSON.stringify(data)); }); } function getJsonTime () { alert ("Testing Alerts!"); $.getJSON("http://time.jsontest.com", function(data){ alert(data); }); } </script> <style> body {font-family:arial;background-color:white} </style> </head> <body> <h3>Get JSON1 - Test on W3Schools File (Internet)</h3> <button onclick="doJSON1()">Get JSON</button> <h3>Get JSON - Test Time (jsontest.com)</h3> <button onclick="getJsonTime()">Get JSON Time</button> </body> </html>
- Tags:
- HTML5
- Intel® XDK
Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Which mobile platform are you testing on? If Android, I recommend using the Debug Tab to evaluate the network traffic of your application.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
This might be your problem: https://en.wikipedia.org/wiki/Cross-origin_resource_sharing
Adding <script src="xhr.js"></script> solves the issue. I tested it on App Preview for Android.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi Elroy,
I tried with that but is not working.I don't see what I'm missing. I dont understand what happened, because it was working on APP Preview with any modification and from last two or three days all the test I was doing with the sample apps stops running.
I'm testing with app preview in Android but isn't working on Samsung S4 (5.01) or BLUE LIFE PURE MINI (4.2.1).
Thanks in advance for any help.
AF
<!DOCTYPE html> <html> <!-- * Please see the included README.md file for license terms and conditions. --> <head> <title>Blank Cordova Mobile App Project Template (Lite)</title> <meta http-equiv="Content-type" content="text/html; charset=utf-8"> <!-- see http://webdesign.tutsplus.com/tutorials/htmlcss-tutorials/quick-tip-dont-forget-the-viewport-meta-tag --> <meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=no"> <style> /* following two viewport lines are equivalent to the meta viewport statement above, needed for Windows */ /* see http://www.quirksmode.org/blog/archives/2014/05/html5_dev_conf.html and http://dev.w3.org/csswg/css-device-adapt/ */ @-ms-viewport { width: 100vw ; zoom: 100% ; } @viewport { width: 100vw ; zoom: 100% ; } @-ms-viewport { user-zoom: fixed ; } @viewport { user-zoom: fixed ; } </style> <script src="cordova.js"></script> <!-- phantom library, needed for Cordova api calls, added during build --> <script src="js/app.js"></script> <!-- recommended location of your JavaScript code relative to other JS files --> <script src="xdk/init-dev.js"></script> <!-- normalizes device and document ready events, see README for details --> <script src="xhr.js"></script> <!-- phantom library, needed for XDK CORS --> <script src="intelxdk.js"></script> <!-- phantom library, needed for XDK api calls --> <script src="js/init-dev.js"></script> <script type="text/javascript" charset="utf-8" src="http://code.jquery.com/jquery-2.0.3.min.js"></script> <script> function doJSON5() { $.getJSON('http://www.w3schools.com/website/customers_mysql.php', function (data) { alert(JSON.stringify(data)); }); } </script> </head> <body> <p>Hello, Cordova!</p> <h3>Get JSON5 - Test on W3Schools File (Internet)</h3> <button onclick="doJSON5()">Get JSON</button> </body> </html>
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
For the 4th time I've submitted an app called wwmob successfully through Intel XDK version 2807 but the in the phone's installed app launcher icon keeps being the Cordova logo (kind of "cubic" Android). Could someone tell me where in the process of develop and build I should have to enter the right icon? Is there a way for replacing the Cordova icon by the right one in the installed app? Thanks.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
@Rui, check out this faq- https://software.intel.com/en-us/xdk/faqs/cordova#cordova-cli-build-icons
The Hello Cordova additions file is a fine example of how to include icons. Please use that as a reference - https://github.com/gomobile/sample-hello-cordova/blob/master/intelxdk.config.additions.xml
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Alberto F. Are you seeing any network traffic activity in your application via the Debug Tab's Chrome Developer Tools? Are any of your HTTP requests returning a response?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi Elroy,
I can't see the phone on the debug tab... I trying with the drivers, but I check the App Preview on IPAD and its working fine, but the same app or code it's not working on App Preview on Android (S4, BLUE or Samsung Galaxy TAB 3).
Thanks in advance for any help.
AF
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi Elroy,
I just checked on debug tab and it works on Blue Life Pure Mini, but still can`t get it to run on APP Preview.
Thanks in advance for any help.
AF
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Is there any news over this?
Since i've updated to 2807 i'm having the same issue.
All my ajax-calls aren't executed anymore :(
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi Wesley,
No, I don`t have any news about it.
The ajax calls are working fine on the App Preview on IPAD but do not work on APP Preview on Android on any of my device.
They work on android only on the DEBUG tab.
AF
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
There are some issues with App Preview 2.7 and network access that engineering is looking into. Look for an update via the Google store.
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page