Phonegap cannot use URL to transmit Parameters

Source: Internet
Author: User

The problem has been solved. You can use URL to transmit parameters between static pages. An error is reported on the Android device:

A networkErrorOccurred. (File: // Android _Asset/Www/myurl.html? Id = 45)

Cause: phonegap does not support static page url passing Parameters

Solution: Use HTML5 ------------>Localstorage:

A.html page:

 

<HTML> ....... <SCRIPT> localstorage. id = 45; </SCRIPT> <a href = "B .html"> jump to the second page </a>  

 

B .html page:

<HTML> ....... <SCRIPT> var SID = localstorage. ID; document. write ('the passed ID is: '+ Sid); </SCRIPT>  

In a small example, implicit parameter transfer is implemented. Other parameters such as asynchronous loading (Ajax and JSON requests) can be handled by themselves.

In addition, localstorage has a long life cycle and can survive at least until the browser is closed!

 

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.