On the mobile phone, you can return to the previous page (WAP2.0) instead of history. Go (-1)

Source: Internet
Author: User

Recently, WAP2.0 is working on a mobile WAP. When writing back to the previous page, it started to use history. Go (-1 );

We found that only some machines on the mobile phone can be like Windows Mobile, while other machines, such as Nokia and ophone

This is not easy to use. After thinking about it, I finally thought of a method to solve this rogue problem...

The mobile phone's return function is not used directly. Instead, the mobile phone's return to the previous page is implemented by reading the link of the previous page on the referrer.

CodeAs follows:

JavaScript code

/* Return to the previous page */<br/> function return_prepage () <br/> {<br/> if(window.w.doc ument. referrer = "" | zookeeper Doc ument. referrer = Window. location. href) <br/>{< br/> window. location. href = "{Dede: Type} [field: typelink/] {/Dede: Type}"; <br/>}else <br/>{< br/> too many location.href?##doc ument. referrer; <br/>}</P> <p>}

 

Direct call where needed;

Javascript: return_prepage ();

Related Article

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.