Hi! I'm trying to pass a long string that contains data from a XML file (141KB) to a Javascript function:
Dim codigoJS As String = $"recibeString("${xmlData}");"$
wvExtras.executeJavascript(codigoJS)
Log("[" & DateTime.Time(DateTime.Now)&"] " & "Se termino de pasar datos XML a Javascript. Long:"&codigoJS.Length)
This xmlData is received using:
Sub DownloadXML(osmFile As String) As ResumableSub
Dim j As HttpJob
Dim Link As String=proxiServerURL & osmFile
j.Initialize("", Me)
j.Download(Link)
Wait For (j) JobDone(j As HttpJob)
If j.Success Then
xmlData=j.GetString
Log("[" & DateTime.Time(DateTime.Now)&"] " & "Archivo OSM descargado...")
End If
j.Release
Return j.Success
and in Javascript I have:
function recibeString(mString) {
try {
console.log( " String recibido: " + mString);
} catch (e) {
console.log("ERROR en recibeString: " + e);
}
}
and I receive:
ERROR: Uncaught SyntaxError: Invalid or unexpected token en file:///android_asset/proxishopper.html (Linea: 1)
I also tried to escape my string using $xml:
Dim codigoJS As String = $"recibeString('$xml{xmlData}');"$
But still the same. I use this method (executeJavascript()) to call another Javascript functions passing them some string parameters and work fine!
It seems to be that this method couldn't finish to ensemble the function call including my XML string (with especial characters, scaped or not)
Can you help to figure out a solution? Hope so