Our company made a use of Baidu Wallet mobile Web page payment to pay the product, the user through Baidu Wallet, Baidu sticky rice scan US
Product two-dimensional code, select merchandise, click Payment will automatically call Baidu Wallet to pay, pay success after return success page, in our success page has closed
Page button, click the Close button or the return button will close the page.
Baidu Wallet in the use of Light Blightapp.closewindow () method can be closed, but in the Baidu glutinous rice, according to the truth can use Ah,
But not at all, and not in the traditional window.close () . At that time we search online and Baidu glutinous Rice's official website, did not find a solution. Later
Through the twists and pains to contact the Baidu sticky rice related technology to find a solution.
The workaround is simply to set the jump address to bainuo://home.
The first type: Click the button to close the page
Click the button to close the page
As shown in the figure, clicking the button will close the page with the following code:
<center><a href= "Bainuo://home" ><button style= "WIDTH:200PX;HEIGHT:50PX;FONT-SIZE:16PX;" > Click button Close </button></a></center>
Second: Click on the App return button or phone's back key to close the page
Click on the App return button or phone's back key to close the page
Click the "<" button in the red box or the physical button on the back of the phone to close the page with the following code:
Introducing jquery:
<script src= "Http://ajax.googleapis.com/ajax/libs/jquery/1.11.0/jquery.min.js" ></script>
Specific implementation code:
$ (function () {
pushhistory ();
Window.addeventlistener ("Popstate", function (e) {
pushhistory ();
var ua = Navigator.userAgent.toLowerCase ();
if (Ua.match (/micromessenger/i) = = "Micromessenger") {
weixinjsbridge.call (' CloseWindow ');
} else if ( Ua.indexof ("Alipay")!=-1) {
alipayjsbridge.call (' Closewebview ');
} else if (Ua.indexof ("Baidu")!=-1) {
blightapp.closewindow ();
} else if (Ua.indexof ("Bdnuomi")!=-1) {
window.location.href= "bainuo://home";
}
else{
window.close ();
}
, false);
function Pushhistory () {
var state = {
title: "title",
URL: "#"
};
Window.history.pushState (state, "title", "#");
}
);
The above is a small set to introduce Android on the Baidu Sticky rice app close the Web page or window (99% ungrateful), I hope to help you, if you have any questions please give me a message, small series will promptly reply to everyone. Here also thank you very much for the cloud Habitat Community website support!