Hi,
I am Running the below code and its working perfect on wamp server localhost but when I upload it on my media temple grid server then the map location doesnt trigger in iframe.
on root i have two files Fetch.php and Index.php
Index.php Javascript’
<script
src="https://code.jquery.com/jquery-3.2.1.min.js"
integrity="sha256-hwg4gsxgFZhOsEEamdOYGBf13FyQuiTwlAQgxVSNgt4="
crossorigin="anonymous"></script>
<script>
//Table script
function changeChannel(){
document.getElementById("twitchFrame").src = "https://maps.google.com/maps?q='+latitude+','+longitude+'&hl=es;z=14&output=embed".value;
}
function changeChannel(){
document.getElementById("twitchFrame").src = "http://120.138.9.121:8888/psp/GetLRStatusWebLink?p=" +document.getElementById("channel").value;
}
</script>
<script type="text/javascript">
$(document).ready(function(){
var longitude, latitude, ret = 0;
$('#submit-this').click(function(){
track_id = $('#channel').val();
console.log(track_id);
var url = "";
$.ajax({'type':'get','url':'fetch.php?track='+track_id,success:function(response){
ret = response.split(',');
longitude = ret[0];
latitude = ret[1];
console.log('Longitude :'+longitude+' Latitude :'+latitude);
url = 'https://maps.google.com/maps?q='+longitude+','+latitude+'&output=embed';
$('#abc_frame').attr('src', url)
}});
});
});
Index.php Body
Track Your Consignment:
<input type="text" id="channel"></input>
<button type="button" onClick="changeChannel(); changeloca();" id="submit-this">Submit</button><br><br>
<div id="container">
<div id="left">
<iframe
id="twitchFrame"
src="about:blank"
height="500"
width="650"
frameborder="0"
scrolling="no"
allowfullscreen="true">
</iframe>
</div>
<div id="right">
<iframe id="abc_frame"
src="about:blank"
width="650"
height="300"
frameborder="0"
scrolling="no"
marginheight="0"
marginwidth="0" ></iframe>
</div>
<div class="clear"></div>
</div>
Fetch.php
<?php
echo file_get_contents(‘http://120.138.9.121:8888/psp/GetLRStatuslocation?p=’.$_GET['track’]);
?>
please Let me know what I am doing wrong
Thanks in Avance