[OpenLayers-Users] OpenLayers.Request.GET doesn't get data

Tobias Wendorff tobias.wendorff at uni-dortmund.de
Tue Sep 22 17:30:56 EDT 2009


Hi there,

how can I make OpenLayers.Request.GET work?

I've changes this in the example-file "click.html":

trigger: function(e) {
     var lonlat = map.getLonLatFromViewPortPx(e.xy);
     var request = OpenLayers.Request.GET({
         url: 'http://127.0.0.1/coordinates.php',
         params: {get: lonlat}
     });
     alert(request.responseText);
}

"coordinates.php" looks like this:

<?php
header('content-type: text/plain');
echo $_GET['get'];
?>

The PHP-script works without a problem, but the messagebox
of OpenLayers is empty. What's wrong here?

Best regards,
Tobias



More information about the Users mailing list