Matt_B
Well-Known Member
Anyone in here any good with AJAX?
Basically I have a main page, call it index.php, which has a JS function declared, call it Reload(depth,width).
I use AJAX to load a page, call it data.php?id=1
I get the AJAX page to run a DB query and echo "<script type=\"text/javascript\">Reload('" . $data["depthBedding"] . "','" . $data["trenchWidth"] . "');</script>";
For some reason this isn't running the Reload function declared in the main page. Any idea why?!?!
EDIT: It does echo the javascript content into the page correctly, it just doesn't run the function. Do I need to declare it global somehow?
Basically I have a main page, call it index.php, which has a JS function declared, call it Reload(depth,width).
I use AJAX to load a page, call it data.php?id=1
I get the AJAX page to run a DB query and echo "<script type=\"text/javascript\">Reload('" . $data["depthBedding"] . "','" . $data["trenchWidth"] . "');</script>";
For some reason this isn't running the Reload function declared in the main page. Any idea why?!?!
EDIT: It does echo the javascript content into the page correctly, it just doesn't run the function. Do I need to declare it global somehow?
Last edited: