Shang HTML5 Mobile Phone development path (in)--jquerymobile parameter passing between pages

Source: Internet
Author: User

Pass parameters based on a single page template http through a road post and get request. In multi-page templates, and without the need for server communication, there are typically three ways to implement parameter passing between pages in a multi-page template.

1. Get Road: The previous page generates parameters and passes to the next page, and then the get content is parsed on the next page.

2, through the HTML5 Web Storage to pass the parameter.

3. Create the current page variable. In the previous page, assign the required parameters to the variable. In the latter page, take the parameters from the variables. (Weak program flexibility)

First, a get way to achieve the inter-page parameter transfer

<! DOCTYPE html>

watermark/2/text/ahr0cdovl2jsb2cuy3nkbi5uzxqvzgf3yw5nyw5iyw4=/font/5a6l5l2t/fontsize/400/fill/i0jbqkfcma==/ Dissolve/70/gravity/southeast "/>

Note: To indicate the form of an access page as an external link form rel= "external", otherwise the inter-page parameter transfer does not work.

Second, through the HTML5 Web storage feature to achieve the parameters of the transfer

Usually consists of two parts, Sessionstorage is store content in the form of a session stored in the browser, because it is session-level storage. When the browser is closed. All the content in the sessionstorage disappears. Localstorage is persistent-based storage, similar to the use of cookies in traditional HTML development, and will not be deleted unless the content in the Localstorage is actively deleted.

Check browser support Web Storage features:

<! DOCTYPE html>
Usually. When we implement the inter-page parameter transfer in jquery Mobile, we do not use the localstorage instead of the sessionstorage because it does not have to be persisted locally.

<! DOCTYPE html>




Copyright notice: This article blog original articles, blogs, without consent, may not be reproduced.

Shang HTML5 Mobile Phone development path (in)--jquerymobile parameter passing between pages

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.