在Corona sdk中,如何在Web视图中显示页面之前操作网页的DOM?

时间:2016-05-28 04:32:10

标签: html dom lua corona

在Corona中,您可以使用网址在网页视图中显示网页。我不确定如何在Web页面视图中显示之前操作页面的DOM。

local webView = native.newWebView( display.contentCenterX,display.contentCenterY, 320, 480 )

webView:request( "http://www.coronalabs.com/" )
-- or
webView:request( "localfile.html", system.ResourceDirectory )

1 个答案:

答案 0 :(得分:0)

您将从网页获取字符串响应。您可以操作和保存文件,并执行您需要执行的操作。看看这个例子我把我需要的子串分开了: How to retrieve data from CK Editor in corona sdk?

然后使用本教程打开/创建文件并更改内容: https://docs.coronalabs.com/guide/data/readWriteFiles/index.html