Android webview does not display Javascript Append

I’m using webview for my Android application, I’m getting my php, html files from my server online. The problem is, when I try it in my desktop browser, it’s displaying the appended text, but when I try it on my Android phone, it’s not displaying.Please note that Javascipt is enabled in my webview’s settings. …

via Android Application Development » Search Results » ajax:

Android webview does not display Javascript Append

I’m using webview for my Android application, I’m getting my php, html files from my server online. The problem is, when I try it in my desktop browser, it’s displaying the appended text, but when I try it on my Android phone, it’s not displaying.
Please note that Javascipt is enabled in my webview’s settings. I also use JQuery Mobile plugin.
Code:
function loadMore()

$(‘#htmlDivID’).append(“HELLO WORLD.”);

…………………………

Try this:
mWebView.setWebChromeClient(new WebChromeClient());i.e. by supplying the default WebChromeClient() is enough to get JavaScript alert() to work.
…………………………

Try using jquery mobile:
function loadMore()
$(‘#htmlDivID’).append(“HELLO WORLD.”);

$(document).on(‘pageinit’, function(event)
loadMore();
);from docs:
Triggered on the page being initialized, after initialization occurs. We recommend binding to this event instead of DOM ready() because this will work regardless of whether the page is loaded directly or if the content is pulled into another page as part of the Ajax navigation system.

For more info: Android webview does not display Javascript Append

Android Application Development » Search Results » ajax

Android webview does not display Javascript Append

Share this post:

Related Posts

Leave a Comment