1

I am wondering, if you had to describe or draw the logic behind calling a web service, while using, jQueryMobile, HTML5, CSS, Java-Script.

For example, in the Android platform. We have.

1.User Interface in an XML file, or Java

2.Behavior, in java classes. In those classes we have then all the behavior, connectivity and so on.

3.In the java class, we can write java code to interact with an external Web-service.

In a Mobile Web App we have

  1. User interface, HTML,CSS,JS (include frameworks, jQueryMobile etc...)

How about the behavior?? I know JavaScript is for behavior, but is it used also to call web services, update, download, files, text and so on?

4

1 回答 1

1

Short answer, yes.

jQuery ajax is great for updating and downloading data in your html.

$.ajax({
  type: "POST",
  url: "update/user/",
  data: { name: "Daniel", location: "Sweden" }
}).done(function( msg ) {
  alert( "response: " + msg );
  // set text area to msg etc..
});

For more inspiration, check out google playground

于 2013-02-21T12:04:03.403 回答