diff --git a/example/src/main/assets/demo.html b/example/src/main/assets/demo.html
index c1dd3d1..dc358fc 100644
--- a/example/src/main/assets/demo.html
+++ b/example/src/main/assets/demo.html
@@ -94,16 +94,22 @@
var data = {
'Javascript Responds': '测试中文!'
};
- console.log('JS responding with', data);
- responseCallback(data);
+
+ if (responseCallback) {
+ console.log('JS responding with', data);
+ responseCallback(data);
+ }
});
bridge.registerHandler("functionInJs", function(data, responseCallback) {
document.getElementById("show").innerHTML = ("data from Java: = " + data);
- var responseData = "Javascript Says Right back aka!";
- responseCallback(responseData);
+ if (responseCallback) {
+ var responseData = "Javascript Says Right back aka!";
+ responseCallback(responseData);
+ }
});
})
-