mobileControlDo
Pierre Sahores
sc at sahores-conseil.com
Thu Apr 23 16:14:43 EDT 2015
Hi Mark,
Many thanks for your helpful guidance !
Understood : mobileControlDo returns the last line of the executed javascript « as this » , so all works as expected with :
on mouseup
-- mobileControlCreate "browser", "Browser1" inited in the preOpenStack handler --
MobileControlDo "Browser1", "execute", fld « javascript"
answer the result — success --
end mouseup
the « javascript » fld contents :
window.name = Number(window.name) +1;
window.name; // correct statement
OK !
While my previous mistake was to write this, instead :
window.name = Number(window.name) +1;
return window.name; // erroneous statement
KO !
Conclusion : mobileControlDo acts perfectly well to let us store and exchange persistant data between the mobile browser and LC (iOS and Android successfully tested).
Warm Regards,
Pierre
> Le 22 avr. 2015 à 17:46, Mark Waddingham <mark at livecode.com> a écrit :
>
> Hi Pierre,
>
> There is definitely code in the engine to feed the (string) result from the JS script back to 'the result' variable. I've just tried (on iOS):
>
> mobileControlDo sBrowserId, "execute", "1+1"
> answer the result
>
> For me at least, this results in an answer dialog popping up containing the value '2'.
>
> If you can't get this to work, then please do file a bug in the quality center with your example script and more details of your environment.
>
> Warmest Regards,
>
> Mark.
>
> ---
> Mark Waddingham ~ mark at livecode.com ~ http://www.livecode.com/
> LiveCode: Everyone can create apps
>
> On 2015-04-21 17:42, Pierre Sahores wrote:
>> Hi Friends,
>> I can’t find any way to get the returned value (nor as it or the
>> result) after executing the following line of code :
>> "Browser1", "execute", fld "js1"
>> where fld « js1" acts as a simple javascript statements container.
>> Do i miss something or is the mobileControlDo command 100% unable to
>> let us use its execution result ?
>> A simple js « alert() » box display (witch works…) don’t feet my needs...
>> Thanks for any though…
>> Best,
>> --
>> Pierre Sahores
>> mobile : 06 03 95 77 70
>> www.sahores-conseil.com
>> _______________________________________________
>> use-livecode mailing list
>> use-livecode at lists.runrev.com
>> Please visit this url to subscribe, unsubscribe and manage your
>> subscription preferences:
>> http://lists.runrev.com/mailman/listinfo/use-livecode
>
> _______________________________________________
> use-livecode mailing list
> use-livecode at lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode
--
Pierre Sahores
mobile : 06 03 95 77 70
www.sahores-conseil.com
More information about the use-livecode
mailing list