I have two PHP variables that I want to pass to javascript using AJAX.
test.php
$Longitude = json_encode($Long);
$Latitude = json_encode($Lat);
Index.js
$.ajax({
type: 'POST',
dataType: "json",
url:'test.php',
data:
success: function(data)
{
console.log("testing");
}
});
I am new to programming. Please guide how to refer these variable names in the ajax call.