Hi! I'm trying to pass a long string that contains data from a XML file (141KB) to a Javascript function:
This xmlData is received using:
and in Javascript I have:
and I receive:
I also tried to escape my string using $xml:
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
Code:
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)
Code:
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
JavaScript:
function recibeString(mString) {
try {
console.log( " String recibido: " + mString);
} catch (e) {
console.log("ERROR en recibeString: " + e);
}
}
B4X:
ERROR: Uncaught SyntaxError: Invalid or unexpected token en file:///android_asset/proxishopper.html (Linea: 1)
B4X:
Dim codigoJS As String = $"recibeString('$xml{xmlData}');"$
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
Last edited: