G Giuliano Cucchiarini Member Licensed User Longtime User Jan 7, 2015 #1 Hi I am trying to inject some simple javascript instruction to a WebView in B4i, but I do not succeed. For example if I run these 2 simple instructions: B4X: Dim no As NativeObject = WebView1 no.RunMethod("stringByEvaluatingJavaScriptFromString:", Array("alert('Hello!');")) I see the Alert Message box, but I cannot close it... What's wrong with this? Thank you for your help. Giuliano C.
Hi I am trying to inject some simple javascript instruction to a WebView in B4i, but I do not succeed. For example if I run these 2 simple instructions: B4X: Dim no As NativeObject = WebView1 no.RunMethod("stringByEvaluatingJavaScriptFromString:", Array("alert('Hello!');")) I see the Alert Message box, but I cannot close it... What's wrong with this? Thank you for your help. Giuliano C.
Erel B4X founder Staff member Licensed User Longtime User Jan 8, 2015 #2 You are injecting the JavaScript correctly. Which JavaScript do you want to inject? Upvote 0
G Giuliano Cucchiarini Member Licensed User Longtime User Jan 14, 2015 #3 I am able to inject any kind of Javascript, even entire libraries and they work work well. The only problem is the alert message box that does not close. You may try the 2 instructions I sent you and verify... Thank You Giuliano C. Upvote 0
I am able to inject any kind of Javascript, even entire libraries and they work work well. The only problem is the alert message box that does not close. You may try the 2 instructions I sent you and verify... Thank You Giuliano C.
Erel B4X founder Staff member Licensed User Longtime User Jan 14, 2015 #4 See the answer here: http://stackoverflow.com/questions/...se-or-dismiss-a-javascript-alert-in-uiwebview Upvote 0
See the answer here: http://stackoverflow.com/questions/...se-or-dismiss-a-javascript-alert-in-uiwebview