android webview 与javascript 通信显示不出网页 求大神帮忙看一下

package com.example.ctatch;
import android.annotation.SuppressLint;
import android.app.Activity;
import android.os.Bundle;
import android.webkit.WebView;
import android.webkit.WebViewClient;
import android.widget.Toast;

@SuppressLint("JavascriptInterface")
public class WebviewActivity extends Activity {
private WebView webView;
public void onCreate(Bundle savedInstanceState){
super.onCreate(savedInstanceState);
setContentView(R.layout.webview);
webView = (WebView) findViewById(R.id.webview);
webView.getSettings().setJavaScriptEnabled(true);
webView.addJavascriptInterface(this, "view");
webView.setWebViewClient(new WebViewClient(){
private final String E = "javaScript:document.getElementsByTagName('table')[0].style.cssText='border:10px solid red'";
// private final String B = "document.getElementsByTagName('table')[0].style.cssText='border:10px solid red'";
@Override
public void onPageFinished(WebView view, String url) {
// TODO Auto-generated method stub
// super.onPageFinished(view, url);
webView.loadUrl(E);
}
});
webView.loadUrl("http://jwxt.sdwu.edu.cn/jwweb/ZNPK/KBFB_ClassSel.aspx");
Toast.makeText(this, "课表查询", Toast.LENGTH_LONG).show();
}
}

protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_main);
    button = (Button) findViewById(R.id.button1);
    button.setOnClickListener(new OnClickListener(){

        @Override
        public void onClick(View arg0) {
            // TODO Auto-generated method stub
            Intent intent = new Intent(MainActivity.this,WebviewActivity.class);
            startActivity(intent);
        }

    });
}







给这个网页第一个table设置border 执行后网页没显示 只显示 10px solid red 求大神帮忙看一下,是哪里出现问题了

1个回答

Csdn user default icon
上传中...
上传图片
插入图片
抄袭、复制答案,以达到刷声望分或其他目的的行为,在CSDN问答是严格禁止的,一经发现立刻封号。是时候展现真正的技术了!
立即提问