0
我使用以下plugin與科爾多瓦/ PhoneGap的科爾多瓦/ PhoneGap的消息框
我能夠流行開來用這個,我使用由用戶輸入的值有困難的一個提示窗口。我有下面的代碼創建提示 -
window.plugins.messageBox.prompt({title: 'Title', message: 'Message'}, function(button, value){
console.log(button, value)
});
這很好地工作,並將輸出到控制檯的輸入值。當我試圖通過value
另一個函數我碰到下面的錯誤 -
Error in success callback: MessageBox2 = TypeError: 'undefined' is not an object
反正可以看到我錯了?
這是我正在嘗試將值發送給一個函數 -
window.plugins.messageBox.prompt({title: 'Title', message: 'Message'}, function(button, value){
outPutValue(button, value);
});
function outPutValue(button, value){
alert(value);
}
你只在回調函數裏面使用'value'嗎?它沒有在回調之外定義。 – apsillers
您可以發佈您將值傳遞給其他函數的代碼嗎? – freejosh
我已將它添加到我的問題中,它沒有任何花哨只是試圖讓它工作 –