results matching ""
No results matching ""
3.2.Local Storage
The Storage interface of the Web Storage API provides access to a particular domain's session or local storage. It allows, for example, the addition, modification, or deletion of stored data items.
To manipulate, for instance, the read data for storage, a call to the TML.bag.Out() is made; whereas for write data the call is made to TML.bag.In().
¶ 3.2.1. TML.bag.Out()
When passed a key name and a default value, this method will return that key's value in the storage.
TML.bag.Out("token","default value");
¶ 3.2.2. TML.bag.In()
When passed a key name and value, will add that key to the storage, or update that key's value if it already exists.
TML.bag.In("nickName","tim");
¶ 3.2.3. TML.bag.No()
When passed a key name, will remove that key from the local storage.
TML.bag.No("nickName");
¶ 3.2.4. Default Local Storage of Build-in
§ 3.2.4.1. Prefix of Data
In order to separate data from multiple applications on the same server, add a prefix to the database, field, namespace, and so on.
TML.bag._
§ 3.2.4.2. WebSocket Address
Get the address of the WebSocket server of the current app connection.
TML.bag.wss
§ 3.2.4.3. Token
The token of login user:
TML.bag.Out("token")
§ 3.2.4.4. User ID
The id of login user:
TML.bag.id
or
TML.bag.Out("id")
小礼物刷一波,打赏作者

Paypal Donate

Venmo Donate

WeChat微信打赏

Alipay支付宝打赏