How to display local html page in browser control

Getting into LiveCode for iOS? Ask your questions here.

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller

landoke
Posts: 10
Joined: Tue Jan 11, 2011 10:40 pm

Re: How to display local html page in browser control

Post by landoke » Tue Mar 29, 2011 3:18 am

Hi Joel,

You might try doing some of this via javascript in the iOS browser, and have it call a url on touch events, which you then catch. It's a bit hacky, but it might do what you're looking for.

To catch an event, you can use something like this, but make sure to: set iphoneControlSet sBrowserId, "delayRequests", "true"

(That last part evaded me and drove me crazy for a while.)

Code: Select all

on browserLoadRequest pUrl, pReason
    if pUrl contains "?myUniqueCode=" then
        put char offset("?myUniqueCode=",14) to -1 of pUrl into pCode
        -- Do something with pCode
    else
        pass browserLoadRequest
    end if
end browserLoadRequest
Just have the javascript issue the following on an e touch event:

window.location = 'http : / / example . com/?myUniqueCode=' + myEvent;

jstarkman
Posts: 47
Joined: Wed Mar 16, 2011 4:39 am

Re: How to display local html page in browser control

Post by jstarkman » Tue Mar 29, 2011 12:52 pm

Thanks, I'll give this a try. I'm pretty green at this stuff, but I persist, so I'll do my best.

Thanks again,

J

Post Reply