2
我不知道爲什麼,但是當我做了以下的PhoneGap /科爾多瓦InAppBrowser沒有推出
<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功能但不彈出瀏覽器。
n [1]裏面的值是什麼? – Whizkid747 2013-03-02 15:42:59