Sub Process_Globals
Public App As Application
Public NavControl As NavigationController
Private Page1 As Page
Private toolbar1 As Page
Private WebView1 As WebView
End Sub
Private Sub Application_Start (Nav As NavigationController)
NavControl = Nav
Page1.Initialize("Page1")
Page1.Title = "Page 1"
Page1.RootPanel.LoadLayout("provawebview")
NavControl.ShowPage(Page1)
NavControl.ToolBarVisible=True
Dim htmlpage As String
htmlpage="<!DOCTYPE html>"
htmlpage=htmlpage&"<html>"
htmlpage=htmlpage&"<body>"
htmlpage=htmlpage&"<script>function myFunction() {document.getElementById(
htmlpage=htmlpage&"<h1>My First Web Page</h1>"
htmlpage=htmlpage&"<p id='demo'>A Paragraph.</p>"
htmlpage=htmlpage&"<Button Type='Button' onclick='myFunction()'>Try it</Button>"
htmlpage=htmlpage&"</body>"
htmlpage=htmlpage&"</html>"
Log (htmlpage)
WebView1.LoadHtml(htmlpage)
End Sub
Sub WebView1_PageFinished (Success As Boolean, Url As String)
Log ("Page Loaded")
Dim ww As NativeObject=Webview1
Dim scripttext As String
scripttext="myfunction();"
Log (scripttext)
ww.RunMethod("stringByEvaluatingJavaScriptFromString:",Array(scripttext))
End Sub