I'll try and describe the architecture of some of my code, and then
describe my problem to see if anybody out there can help. The code
outlines are only included to show the technology mix and you'll see
that you need not analyse it too much when you hear about the problem
I have, described at the end of all this.

//             .js (javascript file). Bind click button,
                $(".actionOptAdd").bind("click",
                        function()
                        {
                              .
                              .
                              .
                              .
                                $.getJSON('lib/addToProj.php',
                                {
                                    .
                                    .                                    .
                                    .                                    .
                                    .
                               }, function(data)
                               {
                                        .
                                        .
                                       $.each(data, function(i,item)
                                       {
                                           //deal with data
                                       }
                                      // write to the HTML some status
message
                               }
                        }
// Here's the HTML with PHP code where the above actionOptAdd is
associated with the clicking of a button:
<span id="Add_<?php print $i; ?>" class="actionOptAdd"> <input
type="button" name="btnOk_AddToProject_<?php print $i; ?>"
class="button-click-grey" value="Add to Project" /><span>

//And here's the outline of PHP code for addToProj.php................

<?php
include_once("configFiles.php");
$json_array = array(.....
// do some database transactions.
// code here is not important for the problem I am describing
echo json_encode($json_array);

//And now I will describe the problem I am getting. I am finding that
occasionally the addToProj code hangs. I use firephp to debug and the
console diagnostics tell me that it is entering AddToProj (when users
click the button). It hangs right at the beginning of AddToProj
because I have inserted $firephp->log statements right at the
beginning of the configFiles.php which don't get executed before it
hangs. If the log statements are being inserted at the very earliest
opportunity, there is apparently nothing that can hang - but, yes, it
sits there for a few minutes before eventually continuing successfully
through to the end. My question is really whether anyone has
suggestions of debug techniques - perhaps more extensive use of
firephp - so that I can work out what is happening?

Reply via email to