As Michael Antonio pointed out, using Ajax would be the way to do it. Heres my code
HTML
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>JSON</title>
<script src="http://code.jquery.com/jquery-1.11.3.min.js"></script>
<script>
$(function() {
$.ajax({
url: 'http://megarkarsa.com/gpsjson.php',
type: 'GET',
dataType: 'html',
success: function(data, status, xhr)
{
$("#json").html(data);
},
error: function(xhr, status, error)
{
$("#json").html("Error: " + status + " " + error);
}
});
});
</script>
</head>
<body>
<div id="json"></div>
</body>
</html>
However, an error keeps cropping up. Here are the request/response headers, notice the response is force closing the connection.
Request
Host: megarkarsa.com
User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:40.0) Gecko/20100101 Firefox/40.0
Accept: text/html, */*; q=0.01
Accept-Language: en-US,en;q=0.5
Accept-Encoding: gzip, deflate
Referer: http://testsites.kalebklein.com/json1/json.html
Origin: http://testsites.kalebklein.com
Connection: keep-alive
Response
Connection: close
Content-Type: text/html
Date: Mon, 21 Sep 2015 01:52:56 GMT
Server: Apache
Transfer-Encoding: chunked
x-powered-by: PHP/5.4.36
Also notice that the content-type of the response is HTML, and should be JSON if you wish to parse the JSON using the above Ajax function I provided. The error coming back is not helpful whatsoever, meaning that the connection is being cut off or refused by making the Ajax call, and no data is being sent back.
JSON.stringify($yourJSONhere);$.parseJSON($jsonObj);after use$.each();