最终HTML statushHTML =新HTML(“”,true);
statushHTML.setHTML(结果);
//结果我传递字符串
1. result = <b> bold </b> // it displays bold 2. result = <i> italics </i> // it works 3. result = <font color='red'> red </font> // it works again 4. result = <h1> h1 tag </h1> // this also works fine But if i try 5. result = <script> alert('No output') </script> // now it doesn't work It's just displaying it in string format.
答案 0 :(得分:0)
如果您需要使用ScriptInjector
插入脚本。
示例代码:
String script = "alert('No output')";
ScriptInjector.fromString(script).inject();