Hi. Here is the code for two file that demonstrate the Firefox / Firebug error I'm seeing.
If the code is run w/ firebug active the console panel shows an error indicating what looks like an empty response. However, if a breakpoint is set on the line "window.location='index.php';" in the index.php file, and execution is then resumed the console then show the expected response.
I would appreciate any help / guesses / insights to this bug.
Thanks, Mike
index.php:
- <!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title></title>
<script src="jquery-1.7.1.min.js"></script>
<script>
function Confirm_Bug(parm1, parm2)
{
var r=confirm("Please Confirm!");
if (r==true)
{
jqCall_Bug(parm1, parm2);
window.location='index.php';
}
}
function jqCall_NoBug(parm1, parm2){
$.getJSON("ajaxJQsever.php", // SERVER PAGE CALLED BY JQUERY
{ // Data sent via ajaxJQ
"callingType": "NoBug",
"parm1" : parm1, // target select
"parm2" : parm2
}
);
}
function jqCall_Bug(parm1, parm2){
$.getJSON("ajaxJQsever.php", // SERVER PAGE CALLED BY JQUERY
{ // Data sent via ajaxJQ
"callingType": "Bug",
"parm1" : parm1, // target select
"parm2" : parm2
}
);
}
</script>
</head>
<body>
<button onclick="jqCall_NoBug('some data', 3)">NO BUG</button> <!-- call passing some daa -->
<br></br>
<br></br>
<button onclick="Confirm_Bug('some data', 3)">BUG</button> <!-- call passing some daa -->
</body>
</html>
ajaxJQsever.php:
- <?php
require("../Protected/FireFoxBug.inc"); - $callingType = $_GET["callingType"];
$data = array(); - if ($callingType == "NoBug") {
array_push($data, "I do not generate a bug");
}
elseif ($callingType == "Bug") {
array_push($data, "If you see this I didn't generate a bug");
} - $jsonData = json_encode($data);
echo $jsonData;
?>