APICloud Tutorial

First, the layout and data for the front end App interact APICloud
App distal layout:
the Window: Window
Frame: a sub-window
set a set of sub-windows: FrameGroup

layout window + frame + html code of
the entire page is a window outermost, fixed head and navigation, as a frame, the lower the content area is a frame, which frame is the entire contents of a specific page, nested inside the html \ css Code

The process of opening a new window, the html is in this combination + frame set window +, another set of the opening process window + frame + html combined

Next page content simplest case, the code can be loaded directly in the window which htmlcss

Open child windows: api.openFrame
function OpenFrame () {
api.openFrame ({
name: "", // child window name
url: "", // the address sub-window
rect: {// x and y coordinate position is , start coordinate, w and h is a sub-window, the width and height of
X: 0,
Y: 0,
W: "Auto",
h: "Auto"
}
})
}
open child windows group: api.openFrameGroup
open a new window: api.openWin

Pull-down refresh: api.setRefreshHeaderInfo
apiready = function () {
api.setRefreshHeaderInfo ({
visible: to true,
bgColor: "# ccc",
textColor: "# FFF",
textDown: "try to pull",
textUp: "Try to try ",
showTime: to true
}, function () {
// Coding ...
// query the database
to determine whether there is new data //
// update the new data
api.refreshHeaderLoadDone ();
})
}

The method defined in uniform:
apiready = function () {
OpenFrame ();
}

Data exchange:
data storage:
File module: catalog operations, file operations
file storage for pictures, upload and download documents Remove
db: local sqlite database
to store offline data
localstorage: html5, localstorage
used to store some variables transfer, such as the user's login status, variable between a plurality of pages transmitted
Note: cookie, session can not be used
preterence: setPrefs, getPrefs, removePrefs
personalized apicloud packaged preference data storage module, such as the application of the skin, font size setting

And self-built network communications server
api.ajax

Guess you like

Origin blog.51cto.com/9161018/2406538