The combination of Firebug and FirePHP brought me the break through
I've been looking for!! Actually I've only just seen your message,
Erik. Having realised that firebug wouldn't help me much with the PHP
I googled debugging php firebug and now I'm armed with the tools I
could have done with a while back.Thanks a lot Hector and Erik. When a
PHP function is called from JQuery, FirePHP is vital because alerts
etc. can't be used. Debugging without having to insert loads of alerts
is far superior anyway, of course.

On Apr 2, 10:55 am, Erik <erik.za...@gmail.com> wrote:
> You should really try the combination of Firebug and 
> FirePHP...http://www.firephp.org/
>
> On Apr 2, 12:40 am, LinkGuru <i...@legalanalytics.co.uk> wrote:
>
> > Thanks. I've installed the add-on. I'll give it a whirl.
>
> > On Apr 1, 8:00 pm, Hector Virgen <djvir...@gmail.com> wrote:
>
> > > You should try using Firebug. You can print directly to the Firebug 
> > > console
> > > from within PHP, or you can just echo "some message" and look at the
> > > response tab of the firebug console.
> > > -Hector
>
> > > On Wed, Apr 1, 2009 at 11:56 AM, LinkGuru <i...@legalanalytics.co.uk> 
> > > wrote:
>
> > > > Hi, I am looking for some help debugging jQuery being used with PHP in
> > > > the way described. I basically want a way of tracing where it gets to
> > > > in the PHP because the usual methods of writing out statements to the
> > > > page or embedding javascript alerts are not available to me in this
> > > > scenario. I will now explain.
>
> > > > I have some PHP (in a file called addToProj.php) which relies on the
> > > > last 3 lines of code being something similar to the following so that
> > > > jQuery can pick up returned data (including data for debugging
> > > > purposes)
>
> > > >                $json_array["status"]="point end";
> > > >                echo json_encode($json_array);
> > > > ?>
>
> > > > The jquery looks something like this, with the unimportant lines
> > > > removed.....
>
> > > >                $(".actionOptAdd").bind("click",
> > > >                        function()
> > > >                        {
> > > > .
> > > > .
> > > > .
> > > >                                $.getJSON('lib/addToProj.php',
> > > >                                {....}, function(data)
> > > >                        }, function(data)
> > > >                                {
> > > >                                   $.each(data, function(i,item)
> > > >                                   {
> > > >                                    if ( i == "status"
> > > > )$('#field).val(item);
> > > >                                   });
> > > >                                });
> > > >                        }
> > > >                );
> > > > //===========================
> > > > I am using json to return data to the jQuery (at the end of the day I
> > > > will need to return more than one data item) and then updating a field
> > > > on my html page. At the moment the return data is just for tracking
> > > > down where I have got to in the PHP. I should point out that I can't
> > > > insert statements like
>
> > > > echo "<script type='text/javascript'>alert('got here xx');</script>";
>
> > > > in my PHP (for some strange reason) to debug the PHP. Also, I can't
> > > > place lines like
>
> > > >                $json_array["status"]="message for debugging";
> > > >                echo json_encode($json_array);
> > > >                return();
>
> > > > at various points in the php, because it breaks the code. Also just
> > > > doing print '<p>something</p>'; can't be done in this case.
>
> > > > Has anyone got an idea of how I can solve the above. Your replies will
> > > > be greatly appreciated.
> > > > What is the easiest way of

Reply via email to