How to block a control from being loaded within a webview in Android
I am using webview within my app to open a page. As开发者_如何转开发 expected, when a dropdown in the website is clicked, a selection is opened. But i donot want this to happen. I want my webview to block a control (either dropdown, or textbox (of html) ), from being opening. So in short, i want to block a control of a website within the webview. How do i do this? Any help would be appreciated.
Thanks
Are you loading a remote HTML page or do you provide an HTML string to the WebView? If you are in the second case, you can add an (I'm talking about Javascript) event handler for the click event on the control and in this event handler you stop the propagation of the event.
This is similar How to stop event propagation with inline onclick attribute?. This is also related event.preventDefault() vs. return false, when using jQuery.
精彩评论