2

理由はわかりませんが、次のことを行うと

<img id="buttons" src="https://qikout.com/apppics/MerchantPromo.png" style="margin:1% auto; width:99% !important;" onclick="openextlink('https://qikout.com');"/>

function openextlink(url)
{
var ref = window.open(url, '_blank', 'location=no');
//window.plugins.childBrowser.showWebPage(url, { showLocationBar: true });
}

それは正常に動作します。しかし、別の関数内からopenextlinkを実行したい場合、ウィンドウは開かず、代わりにページをロードしますが、ユーザーに表示しません。

例えば

function scan(){

    window.plugins.barcodeScanner.scan( function(result) {
            if(result.format != "QR_CODE")
            {
            alert("That is not a valid google Tag");
            }
            else
            {
                n = result.text.split(".com/");
                loadpet();

                    //alert("We got a barcode\n" +
                    //     "Result: " + result.text + "\n" +
                    //     "Format: " + result.format + "\n" +
                    //     "Cancelled: " + result.cancelled);

            }
        }, function(error) {
            alert("Scanning failed: " + error);
        }
    );

}

function loadpet(){
    $("#buttons").trigger("click");
    var link = "http://www.google.com/" + n[1];
    openextlink(link);
}

それは経由で動作します

<div onclick="scan();" class="menu-right"></div>

基本的には正常にスキャンし、結果を取得して結果を loadpet 関数に移動し、それを openextlink 関数に送信しますが、ビューアーはポップアップしません。

4

1 に答える 1