この例はそのままではありません。「proxcardCallbacks」および「onError」のパラメータを独自の関数に置き換える必要があります。
はこれを試してみてください:
<button onclick="grabba.proxcard.registerCallback({ //Functions may also be declared inline as seen here.
triggeredEvent: function() {
alert('Proxcard triggered');
},
//These functions are optional and unimplemented functions will simply not be called.
//stoppedEvent : function() {
//alert('Proxcard scanning stopped');
//},
scannedEvent: function (proxcard) {
////proxcard contains data fields
////Convert the data to a base 16 hex string
try {
//alert('data: ' + proxcard.data);
var hexString = grabba.util.integerArrayToHexString(proxcard.data);
alert('Proxcard scanned event\n Data: ' + hexString + '\n');
} catch (err) {
alert('catch error ' + err);
}
},
timeoutEvent: function() {
alert('Proxcard timed out');
}
}, function (errorString) {
alert('on error ' + errorString);
});">Scan</button>
PS:私は削除されたことに注目してください "アドオンを。" "integerArrayToHexString"関数の呼び出しを頼りにしています。
あなたの問題は何ですか?エラーが発生していますか? – Schlaus
いいえ、私はコードを実行しようとすると、システムがそれを入力しますが、私はライブラリを呼び出す行で停止します。もし私が何をしたいのか分かっていなかったらどうしますか? – FelipeF
例えば、私はregisterCallback(コールバック、onError)を実行しようとしていますが、例は蛇に入れられますが、私はできません。 – FelipeF