Reputation: 1
I had two questions
The first question: I developer app using css3, HTML5, JavaScript. In my application I need to fetch data from the database. How can I do it?
Second question: intel xdk In the build What l have to use a server-side?
Thank you
Upvotes: 0
Views: 835
Reputation: 2458
If you want to access data from remote server, you can make ajax request to the server and get your data for example in json or jsonp format.
$.ajax({
url: 'http://remoteurl.com',
dataType: 'json',
success: function(response) {
jsonData = response;
}
});
Upvotes: 1
Reputation: 251
For database storage you can use localStorage:
localStorage.setItem("item1", "this is a test!"); //stores key/value pair
document.write(localStorage.getItem("item1")); //returns "this is a test"
localStorage.removeItem("item1"); //deletes item1 key and "this is a test" value
Here is an in depth tutorial: http://paperkilledrock.com/2010/05/html5-localstorage-part-one/
You can also use Parse.com APIs if you want your data stored in the cloud: https://parse.com/docs/js_guide#objects
Parse.initialize("YOUR KEY GOES HERE"); //API key
//whatever you want to call your storage object
var PhotoDetails = Parse.Object.extend("PhotoDetails");
//create new instance of your Parse Object
var photoDetails = new PhotoDetails();
//you can add each param separately and save
photoDetails.set("paramname", "value");
photoDetails.save();
//or use object literal notation
photoDetails.save({category: "landscape",
description: "a very cool photo",
location: "33.38453, -28.234234"
}).then(function(object) {
alert("Photo Recorded!);
});
I'm not sure I understand your second question, I think you mean "Why do you have to use Intel XDK build servers to build apps with Intel XDK?"
We build on our build servers in the cloud because it is easier on our users for Intel XDK to handle installing the Android SDK or Cordova CLI, or the latest Crosswalk updates so you don't have to manually install all of those pieces and constantly update your machine. We update the build server regularly even if we haven't released a new version of the Intel XDK. You are free to install all of these pieces separately on your local machine and build apps yourself. If you have any concerns over terms of use or privacy let us know. Our terms of use are: http://appcenter.html5tools-software.intel.com/TOS/
Upvotes: 0