【发布时间】:2019-06-11 07:10:51
【问题描述】:
在胡椒机器人平板电脑中,我必须在点击按钮时在 webview 中显示网页。
如何在raiseevent() 方法中存储对象(html div 元素)
例如:session.raiseevent("eventname", "htmldivelement")
下面的python函数来加载url和webview
def web_view(self):
url = "https://www.google.com"
try:
self.ts.loadUrl(url)
self.ts.showWebview()
#self.showWebview("https://www.google.com")
except Exception, e:
self.logger.info("Error while loading tablet: {}".format(e))
【问题讨论】:
-
1) 按钮在哪里?在平板电脑上的 html 页面上?然后打开按钮点击网页,您可以在 html 中使用简单的 javascript (google.com';" value="Go to Google" />) 2) 有什么你试图传递你的 div 元素?为什么不作为字符串?应该在哪里处理“htmldivelement”?在 Python 代码中?在 Javascript 代码中? 2)
-
按钮在 html 页面上。当点击胡椒机器人上的按钮时,调用下面的函数。功能 openWebPage() { alert('到达 openWebPage'); var displayView = document.getElementById("btnEPay") alert(displayView); ePayPage(displayView); //window.open("epay.com/"); }
-
按钮在javascript代码中处理,webview必须从python代码显示。
-
ePay支付 -
1) 所以你想将一个 div 元素从 javascript 传递给 python 代码。 2) 你想通过 raiseevent “传递” div 元素吗? 3)字符串有什么问题? 4)你试过什么? 5)如果您在问题中添加更多代码,这将有助于理解您的问题
标签: javascript python html pepper