Execute js in a web popup

Say I load a local html file in a web popup.

Can I execute javascript later on in the context of that page later on? If so, how?

Lots of little very useful use cases for that (markers on android google maps, html updates, …)

–Maarten [import]uid: 5822 topic_id: 17001 reply_id: 317001[/import]

Just to be clear, in another toolkit I use you can create a UIWebView control and assign it.

Then you can set properties, and one of them is “execute”, which executes the new properties value on the already loaded page. [import]uid: 5822 topic_id: 17001 reply_id: 63867[/import]

If you make the html page yourself then I guess you could use iweb and code some JS there. I have never tried myself but it should work, iweb has some nice templates for iOS. [import]uid: 9546 topic_id: 17001 reply_id: 63880[/import]

yup just link everything locally in the html file

[code]

– Web Popup Listener
local function listener( event )
local shouldLoad = true
local url = event.url
if 1 == string.find( url, “corona:close” ) then
– Close the web popup
shouldLoad = false
end
return shouldLoad
end

– Web Popup Options
local options = { hasBackground = true , baseUrl = system.ResourceDirectory , urlRequest = listener }
local webPopupPage = “localpage.htm”

– Show Web Popup

native.showWebPopup( 0 , 0 , 320 , 480 , webPopupPage , options )
[/code] [import]uid: 5354 topic_id: 17001 reply_id: 66669[/import]