I normally find my answers through searches, but this ones got me stumped and I can't find any related articles :/
I am simply running an AJAX call to my PHP script and alerting the returned value (JSON encoded object).
The problem is, the script freezes as soon as it hits my 'echo' statement. I have tested without the echo, and even with values such as "Hello" (both which were successful). I also tested an output with an example JSON string that I found online. This failed.
I am now believing that any string structured as JSON will cause this error (I have tested both JSON scripts on jsonlint.com).
All help is greatly appreciated!!!
Javascript Code:
function scan()
{
var script = "../resources/ajax/fincenmanager/load_reports.php";
var params = "";
var return_function = "load_wire";
document.getElementById("loading_screen").className = "show";
ajax(script, params, return_function);
}
function load_wire(text)
{
document.getElementById("loading_screen").className = "hidden";
alert(text);
}
PHP Code:
<?php
require_once("../../config.php");
require_once("../../library/FincenManager/fincenmanagerclass.php");
header("Content-Type: application/json");
$manager = new FincenManager("../../inputs/FincenManager/");
$json = json_encode($manager);
// Script Breaks After This Line.. 100% Sure :/
echo $json;
?>