HTML + Javascript的渲染器,其输出HTML或纯文本?文本、渲染器、HTML、Javascript

由网友(温柔都给你吧)分享简介:如果我使用:字符串平原= Html.fromHtml(HTML)的ToString;渲染简单的HTML,它包含:<!DOCTYPE HTML>< HTML>< HEAD>< META HTTP-当量=内容类型内容=text / html的;字符集= UTF-8><...

如果我使用:

 字符串平原= Html.fromHtml(HTML)的ToString;
 

渲染简单的HTML,它包含:

 <!DOCTYPE HTML>
< HTML>
  < HEAD>< META HTTP-当量=内容类型内容=text / html的;字符集= UTF-8>
    <冠军>谷歌< /标题>
  < /头>
  <身体GT;任何纯vanila HTML到这里
  < /身体GT;
 
报表控件ActiveReportsJS V2.0 Update 1 支持在报表中渲染HTML标签

一切都很好,很正常。

但是,如果该网页包含吨的Javascript code,它是很好的被所有的网络浏览器渲染,但不提供给我?

有没有渲染器负责Javascript的为好,输出HTML或纯文本,即是不是一定要去的视觉显示

(我知道的WebView 但我的理解是,我可以'吨真的进入它的输出,或者可以吗?)

解决方案   

有没有渲染器负责Javascript的为好,输出HTML或纯文本,也就是不一定要去视觉显示?

的WebView 或萧条。

  

(我知道的WebView,但我的理解,我真的不能访问它的输出。或者,我可以?)

创建一个Java对象以接收你的输出 添加了通过 Java对象的的WebView addJavascriptInterface() 使用使用loadURL(JavaScript的:...)的WebView 来调用JavaScript的大块的收集你的信息和你的Java对象调用一个方法

If I use:

String plain = Html.fromHtml(html).toString;

to render simple 'html' that contains:

<!doctype html>
<html>
  <head><meta http-equiv="content-type" content="text/html; charset=UTF-8">
    <title>Google</title>
  </head>
  <body>any plain vanila HTML goes here
  </body>

All is nice and dandy.

But what if that page contains tons of Javascript code that is nicely rendered by all web browsers but isn't available to me?

Is there a renderer that takes care of the Javascript as well, to output HTML or plaintext, that isn't necessarily going to a visual display?

(I know about WebView but my understanding that I can't really access its output. Or can I?)

解决方案

Is there a renderer that takes care of the Javascript as well, to output HTML or plaintext, that isn't necessarily going to a visual display?

WebView or bust.

(I know about WebView but my understanding that I can't really access its output. Or can I?)

Create a Java object to receive your output Add that Java object to the WebView via addJavascriptInterface() Use loadUrl("javascript:...") on the WebView to invoke a hunk of Javascript that gathers your information and calls a method on your Java object

阅读全文

相关推荐

最新文章