Note that there are some explanatory texts on larger screens.

plurals
  1. POLoad specific <div> content into WebView
    primarykey
    data
    text
    <p>I have tried parse out with JSoup and load it into WebView via <a href="http://developer.android.com/reference/android/webkit/WebView.html#loadDataWithBaseURL%28java.lang.String,%20java.lang.String,%20java.lang.String,%20java.lang.String,%20java.lang.String%29" rel="nofollow">loadDataWithBaseURL</a>, but it is relatively slow and needs to be edited with custom CSS.</p> <p>Fastest option for now is to load JavaScript function to filter content of web page. What would be the best way using JavaScript to get only content_center <code>&lt;div id="content_center"&gt;Only this content needs to be displayed in WebView&lt;/div</code>> display from this <a href="http://www.ffzg.unizg.hr/infoz/hr/index.php/lanovi-odsjeka/" rel="nofollow">page</a>.</p> <p>Preferably while page is loading so the user doesn't have to see the changes happening on their screens while JavaScript is doing its job. Right now from this code my layout in WebView is affected by bg_wrapper, while content_center is displayed. </p> <pre><code> @Override public void onPageFinished(WebView view, String url) { webView.loadUrl("javascript:(function() { " + "document.getElementById('logo_section').style.display='none';"+ "document.getElementById('top').style.display='none'; " + "document.getElementById('bg_wrapper').style.display='hidden'; " + "document.getElementById('left').style.display='none'; " + "document.getElementById('right').style.display='none'; " + "document.getElementById('content_center').style.display='visible'; " + "})()"); if(pd.isShowing()){ pd.dismiss(); } } </code></pre>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload