无法在WebView中加载以下网页
https://6awlanow.com/about/faqs
到目前为止,我一直在努力-
webView.getSettings().setJavaScriptEnabled(true);
webView.getSettings().setLoadWithOverviewMode(true);
webView.getSettings().setUseWideViewPort(true);
webView.getSettings().setPluginState(WebSettings.PluginState.ON);
webView.getSettings().setJavaScriptCanOpenWindowsAutomatically(true);
webView.getSettings().setAllowFileAccess(true);
webView.getSettings().setDomStorageEnabled(true);
webView.getSettings().setUserAgentString("Android WebView");
webView.setWebViewClient(new WebViewClient() {
@Override
public boolean shouldOverrideUrlLoading(WebView view, WebResourceRequest request) {
view.loadUrl(request.getUrl().getPath());
//if (progressDialog != null && progressDialog.isShowing()) {
// progressDialog.dismiss();
//}
return true;
}
//If you will not use this method url links are opeen in new brower not in webview
@Override
public boolean shouldOverrideUrlLoading(WebView view, String url) {
view.loadUrl(url);
return true;
}
//Show loader on url load
@Override
public void onLoadResource(WebView view, String url) {
}
@Override
public void onPageFinished(WebView view, String url) {
try {
//if (progressDialog.isShowing()) {
// progressDialog.dismiss();
//}
} catch (Exception exception) {
exception.printStackTrace();
}
}
@Override
public void onReceivedError(
WebView view, WebResourceRequest request, WebResourceError error
) {
//progressDialog.dismiss();
super.onReceivedError(view, request, error);
}
});
我已经提供了互联网许可。除了在WebView上,URL在任何地方都可以正常加载。我得到以下错误-
在我的控制台上获取以下信息-
I: [INFO:CONSOLE(31)] "Uncaught TypeError: Object.assign is not a function", source: https://6awlanow.com/app.c98a13d5a9fdd32775ca.js (31)
I: [INFO:CONSOLE(0)] "Error: Invalid negative value for <rect> attribute ry="-.125"", source: https://6awlanow.com/about/faqs (0)
I: [INFO:CONSOLE(0)] "Error: Invalid negative value for <rect> attribute ry="-.125"", source: https://6awlanow.com/about/faqs (0)
I: [INFO:CONSOLE(0)] "Error: Invalid negative value for <rect> attribute ry="-.125"", source: https://6awlanow.com/about/faqs (0)
I: [INFO:CONSOLE(0)] "Error: Invalid negative value for <rect> attribute ry="-.125"", source: https://6awlanow.com/about/faqs (0)
I: [INFO:CONSOLE(0)] "Error: Invalid negative value for <rect> attribute ry="-.125"", source: https://6awlanow.com/about/faqs (0)
I: [INFO:CONSOLE(0)] "Error: Invalid negative value for <rect> attribute ry="-.125"", source: https://6awlanow.com/about/faqs (0)
I: [INFO:CONSOLE(0)] "Error: Invalid negative value for <rect> attribute ry="-.125"", source: https://6awlanow.com/about/faqs (0)
I: [INFO:CONSOLE(0)] "Error: Invalid negative value for <rect> attribute ry="-.125"", source: https://6awlanow.com/about/faqs (0)
I: [INFO:CONSOLE(0)] "Error: Invalid negative value for <rect> attribute ry="-.125"", source: https://6awlanow.com/about/faqs (0)
I: [INFO:CONSOLE(0)] "Error: Invalid negative value for <rect> attribute ry="-.125"", source: https://6awlanow.com/about/faqs (0)
I: [INFO:CONSOLE(0)] "Error: Invalid negative value for <rect> attribute ry="-.125"", source: https://6awlanow.com/about/faqs (0)
I: [INFO:CONSOLE(0)] "Error: Invalid negative value for <rect> attribute ry="-.125"", source: https://6awlanow.com/about/faqs (0)
对我有用的是
1.启用dom存储和javascript
webView.getSettings().setJavaScriptEnabled(true);
webView.getSettings().setAppCacheEnabled(true);
webView.getSettings().setDomStorageEnabled(true);
2.在处理程序上运行webview
new Handler().post(new Runnable() {
@Override
public void run() {
webView.loadUrl(webview_url);
}
});
使用下面的代码,它应该工作,我测试,它工作。
public class WebViewEx extends AppCompatActivity {
private WebView webView;
private ProgressDialog progDailog;
Activity activity;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_web_view_ex);
webView = findViewById(R.id.webView);
activity = this;
progDailog = ProgressDialog.show(activity, "Loading", "Please wait...", true);
progDailog.setCancelable(false);
webView.getSettings().setJavaScriptEnabled(true);
webView.getSettings().setLoadWithOverviewMode(true);
webView.getSettings().setUseWideViewPort(true);
webView.getSettings().setDomStorageEnabled(true);
webView.setWebChromeClient(new WebChromeClient());
webView.setWebViewClient(new WebViewClient() {
@Override
public boolean shouldOverrideUrlLoading(WebView view, String url) {
progDailog.show();
view.loadUrl(url);
return true;
}
@Override
public void onPageFinished(WebView view, final String url) {
progDailog.dismiss();
}
});
webView.loadUrl("https://6awlanow.com/about/faqs");
}
}
您的XML如下所示:
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
<WebView
android:id="@+id/webView"
android:layout_width="match_parent"
android:layout_height="match_parent" />
</LinearLayout>
以下是我在WebView中得到的结果:
我希望这将解决您的问题,如果您有任何疑问,请告诉我。
但是页面没有加载。有什么建议吗?
问题内容: 我正在尝试使用JavaFX的WebView加载此站点,但我得到的只是一个空白屏幕。WebView在其他站点上运行良好。它在ACID3上获得100/100并加载其他HTTPS站点,没有任何问题。 我也找不到该网站的任何特别错误。它具有由适当的CA签名的适当的,未过期的证书,并且SSL Labs报告为B级。我尝试了所有主要的浏览器,但没有一个报告任何与证书或SSL相关的问题;该网站对所有这
我试图使用JavaFX的WebView加载这个站点,但得到的只是一个空白屏幕。WebView在其他网站上运行得非常好;它在ACID3上获得100/100,并加载其他HTTPS站点,没有任何问题。
我正在netbeans中开发JavaFx应用程序,在netbeans中该项目正在构建并运行良好。 加载屏幕的屏幕控制器: 我的github回购:https://github.com/eszikk/examsupervisorserver
问题内容: 当页面使用AJAX时可以使用隐式和显式等待,但是我想停止由于加载足够的元素而导致的加载。因为调用仅在页面加载完成后才返回,所以可以这样做吗? 问题答案: 是的,可以通过将功能设置为来实现。然后等待一个元素出现并调用以停止加载:
问题内容: 我的问题很简单,如何使用jquery ajax comand检索某些div 喜欢带负载 问题答案: 如果div是AJAX响应的一部分: