把iframe放在Android应用程序上

时间:2015-04-05 23:06:25

标签: android iframe webview

我尝试将我从ifpepeak帐户中获取的iframe图表。

这是我需要放的字符串(我从thingspeak中获取):

<iframe width="450" height="260" style="border: 1px solid #cccccc;" src="http://api.thingspeak.com/channels/31592/charts/1?width=450&height=260&results=60&dynamic=true" ></iframe>

这是我在我的活动中使用的:

 WebView webview;
    webview = (WebView) findViewById(R.id.webview);
    webview.getSettings().setJavaScriptEnabled(true);
    webview.loadData();

我尝试将iframe字符串放在“loadData”函数中,但没有成功。

感谢帮助者;)

3 个答案:

答案 0 :(得分:24)

您可以使用html:

创建字符串
String html = "<iframe width=\"450\" height=\"260\" style=\"border: 1px solid #cccccc;\" src=\"http://api.thingspeak.com/channels/31592/charts/1?width=450&height=260&results=60&dynamic=true\" ></iframe>";

然后调用方法loadData():

webview.loadData(html, "text/html", null);

Click Here for reference

答案 1 :(得分:0)

{"exception":"Doctrine\\DBAL\\Driver\\Mysqli\\MysqliException: Unknown column 'rand()' in 'order clause'...}

答案 2 :(得分:0)

class iFrame {
    constructor (url) {
    this.url = url;
    this.deprecated = true
  }
}

let frame = new iFrame("url_here");

if (frame.deprecated === true) {
   console.log("DEPRECATED PLEASE USE APACHE CORTAVA WAHT")
} else {
    system.main.appendChild(frame);
}