JavaScript-Mobile page a.html Click on the page of Jump B, you need to fill in the page B to the content to a.html. What do you do?

Source: Internet
Author: User

On the fill out the Bank card information page, click the branch to jump to the Select Branch page.

Click on the new Select Branch page to pass this value to the original page?
It's so hard, I haven't done it. Exactly how to do it.

Reply content:

On the fill out the Bank card information page, click the branch to jump to the Select Branch page.

Click on the new Select Branch page to pass this value to the original page?
It's so hard, I haven't done it. Exactly how to do it.

Agree upstairs, and you this is mobile, jump page is very not recommended, before my a project is similar, I do refer to a lot of manufacturers of mobile solutions, no exception is the use of this single-page solution, are put logic in a different level, and then use the button to shadow and display, can also add a little CSS3, to achieve the effect of page flipping, is very good, that is, the pages of logic is more complex, the rationale is good, right, you can go to see how hungry they do, there, Suning's best to do, you go to see

Local storage Can't you?

Do a single page application, b page do not use a separate page, the function of the B page in a page with a completely cover a page layer to do, so the data how to take it,

Upstairs is right, do the spa, select the Bank button click on the second page directly to the layout of a div covering all pages, selected after the use of JS to get the value of the bank to select the block ...

If it's two different pages, you can use cross-document messaging.
On the B page window.postmessage (data, "a page URL");
On the A page window.onmessage = function (event) {

if(event.origin == "B页面URL"){    //处理event.data}

}

Get it, it's okay.

Localstorage should be able to

Window.name can pass data between two pages

Mobile side avoids unnecessary refresh page with popup layer (b) Fill out next hide (b) Then use JS to get (b) The value of the input box
In essence, a page is just a hidden one.

Usewindow.location.hash

It's not recommended to use Localstorage. The less it is, the better. Suggested overlay of page

Can not be made page jump, b page made a page of an IFRAME, click on the Page a button, pop-up iframe,b page after selecting branch execution function parent.choose ("branch name"), on a page define a choose (parameter) function. Can realize the demand, the pros and cons are not compared.

  • 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.