thanks,
what I have to do is assign, from delphi (Browser), a value to the "Distance" element, so that js (render) can read it.
I tried that, but it doesn't work.
Help, thanks
HTML:
Code: Select all
<!DOCTYPE html>
<html>
<head>
<title>Add Map</title>
<script src="https://polyfill.io/v3/polyfill.min.js?features=default"></script>
<link rel="stylesheet" type="text/css" href="mapCli.css" />
<script src="mapCli.js"></script>
</head>
<body>
<!--The div element for the map -->
<div id="map"></div>
<input type="hidden" id="listaCli" value="0"> <<<<<--------------------------------
<!-- Async script executes immediately and must be after any DOM elements used in callback. -->
<script src="https://maps.googleapis.com/maps/api/js?key=KKKKKKKKKK=weekly" async></script>
</body>
</html>
JS:
Code: Select all
function initMap() {
bounds = new google.maps.LatLngBounds();
...
var testSelect = document.getElementById('listaCli');
testSelect.addEventListener('change', function() {
console.log('TTTTTT'+testSelect.value);
flgnocoords = 2;
});
.....
}
Delphi: (Chromium1: TChromium)
Code: Select all
....
sst := ssp + '?' + 'alat=' + '&' +
'alon=' + '&' +
'ars=' + '&' +
'aind=' + '&' +
'afile=' + ssfile + '&' +
'flgoperazione=2' + '&' + 'from=' + 'newclienti';
Chromium1.LoadURL(sst);
Chromium1.ExecuteJavaScript('document.getElementById("listaCli").value = "qwerty";','',0);
Delphi:
Code: Select all
procedure TNewClienti.Chromium1ConsoleMessage(Sender: TObject;
const browser: ICefBrowser; level: Cardinal; const message, source: ustring;
line: Integer; out Result: Boolean);
begin
if LeftStr( message,6) = 'TTTTTT' then
begin
ShowMessage(message);
end;
....
end;