Error in evaluatejavascript with widget browser only on iOS and Livecode > 9.06

Ludovic THEBAULT ludovic.thebault at
Fri Apr 17 02:05:23 EDT 2020


I’ve a strange error :

I have an application where you can change the GPS coordinates from a marker on a map, in a browser widget.
For this I use the code "myJSHandler" which allows to retrieve in Livecode the GPS values of the map thanks to javascript.

The code works fine on desktop, iOS and Android except for iOS apps compiled with Livecode > 9.0.6 (and also with the new Livecode 9.6.0 dp4).
(I’ve not tested with Livecode 9.5). I’ve already tried to remove the widget browser and replace it with a « new ».

When I run the code in my app :
   on myJSHandler theCoords
       wait 100 milliseconds with messages

       put theCoords into tnewcoords

   end myJSHandler

// and the javascript in the html code of the map :
     function getCoords() {
        	liveCode.myJSHandler(document.getElementById('info').value ) ; 

I get an error message:

864,0,0,Value is not of correct type for
assignment to variable - expected type
<type: livecode.lang.string> for
assigning to variable tResult in

but the coordinates are well recovered...

If I change my code with :
on myJSHandler theCoords

 answer « New coordinates are saved !"

  #### no error, so, the bug is here ! ###
   wait 100 milliseconds with messages

   put theCoords into tnewcoords

end myJSHandler

 I don't get the error anymore!

I created a test application with the same code and the same map and I got no error !

You could get this sample stack here to see the complete code (but not the error !) <>

Thanks for your lights !

More information about the use-livecode mailing list