Firebug Causing JSON Parse Error?

379 views
Skip to first unread message

Jim Biancolo

unread,
Feb 22, 2010, 12:18:09 PM2/22/10
to Firebug
Hi folks,

When I upgraded to jQuery 1.4 I started getting JSON parse errors. I
know 1.4 requires valid JSON, so I cut-and-pasted the JSON server
response out of Firebug into JSONLint and jQuery.parseJSON() and both
said my JSON was valid. Finally, I dumped ajaxError.thrownError to the
console, and saw this:

-------
InvalidJSON:{"SUCCESS":true,"ATTACHMENT_FILENAME":"F6A0D547-1D09-
C43B-40F8CCF1E0D2C822","MESSAGE":"Success","ATTACHMENT_ORIGINAL_FILENAME":"something.txt"}

<divfirebugversion="1.5.0" style="display:
none;"id="_firebugConsole"></div>
-------

Ah ha! When I turned off Firebug, my code started working again. Is
there a way to keep Firebug from injecting this?

Thanks!

Jim

John J Barton

unread,
Feb 22, 2010, 12:30:02 PM2/22/10
to Firebug

Firebug injects the div above into the web page if you have Firebug >
Console >enabled. I don't know why you have it in your server data.

jjb

>
> Thanks!
>
> Jim

Pedro Simonetti Garcia

unread,
Feb 22, 2010, 12:32:35 PM2/22/10
to fir...@googlegroups.com
Hi Jim,

This sounds like a bug. Could you please post a small html
file that reproduces this problem at our bug tracking system?
That way, we'll be able to investigate the issue easily.

http://code.google.com/p/fbug/issues/list

Also, could you please disable the Console panel, and see if
the error persists?

regards,

Pedro Simonetti.

2010/2/22 Jim Biancolo <j...@biancolo.com>:

> --
> You received this message because you are subscribed to the Google Groups "Firebug" group.
> To post to this group, send email to fir...@googlegroups.com.
> To unsubscribe from this group, send email to firebug+u...@googlegroups.com.
> For more options, visit this group at http://groups.google.com/group/firebug?hl=en.
>
>

Jim Biancolo

unread,
Feb 22, 2010, 2:51:54 PM2/22/10
to Firebug
Hi Pedro,

When I disable the console the error goes away.

I'm sorry to report though that I spent a couple hours trying to
create a simple page that reproduced the problem to no avail. When I
build a simple page that does an Ajax request of a text file
containing some static JSON, Firebug does not inject the DIV into the
response. Unfortunately the page where I do get the error is in a
private application, so I can't give you that URL. If I can figure
out what it is about that page that produces the behavior, I will
definitely submit it to your bug tracking system.

Sorry! Thanks for the response.

Jim

On Feb 22, 12:32 pm, Pedro Simonetti Garcia <pedrosimone...@gmail.com>
wrote:

John J Barton

unread,
Feb 22, 2010, 3:42:52 PM2/22/10
to Firebug

On Feb 22, 11:51 am, Jim Biancolo <j...@biancolo.com> wrote:
> Hi Pedro,
>
> When I disable the console the error goes away.
>
> I'm sorry to report though that I spent a couple hours trying to
> create a simple page that reproduced the problem to no avail.  When I
> build a simple page that does an Ajax request of a text file
> containing some static JSON, Firebug does not inject the DIV into the
> response.  Unfortunately the page where I do get the error is in a
> private application, so I can't give you that URL.  If I can figure
> out what it is about that page that produces the behavior, I will
> definitely submit it to your bug tracking system.

I guess that somehow the private application must use a window in its
processing, perhaps even a hidden iframe. Perhaps the application
writes the json in the window document then processes it expecting the
window to remain blank.

jjb

Jim Biancolo

unread,
Feb 23, 2010, 9:55:37 AM2/23/10
to Firebug
Hi guys,

I spent a bit more time this morning and was able to create a simple
test case. I created an issue here:

http://code.google.com/p/fbug/issues/detail?id=2862

It turns out reproducing it was not complicated at all, and there's no
iframing or windowing involved (although I don't know what jQuery and
the form plugin do behind the scenes to facilitate Ajax form
submissions). I was unable to reproduce it yesterday because I was
just posting to a json.txt file and Firebug did not inject anything
into the response (which just returned the contents of json.txt). But
when I instead posted to a json.php file that output json, Firebug
started injecting the DIV.

Thanks!

Jim

John J Barton

unread,
Feb 23, 2010, 11:20:39 AM2/23/10
to Firebug

On Feb 23, 6:55 am, Jim Biancolo <j...@biancolo.com> wrote:
> Hi guys,
>
> I spent a bit more time this morning and was able to create a simple
> test case.  I created an issue here:
>
> http://code.google.com/p/fbug/issues/detail?id=2862

I was not able to reproduce the problem using the test case. I do see
an error message, but no evidence that Firebug disturbed the json
processing.

jjb

Jim Biancolo

unread,
Feb 23, 2010, 11:43:16 AM2/23/10
to Firebug
Hmm. Looks like it must be something specific to my setup. When I
boot into a clean Firefox profile, with Firebug as the only extension
installed, I can't reproduce the error either. I should have tried
that before filing the bug, sorry!

On Feb 23, 11:20 am, John J Barton <johnjbar...@johnjbarton.com>
wrote:

Marta

unread,
Feb 24, 2010, 5:06:22 AM2/24/10
to Firebug
Hi guys,

I have a similar problem. After upgrading to firebug 1.5.2 (but also
downgrading to 1.5.0), in a jquery axaj response that should be a json
one (it worked before), firebug interpreted it as XML so it gave an
error about invalid XML, and from that moment, the firebug console
didn't work anymore (I have to restart firefox).

Thank you in advance for your suggestion.

Marta

Marta

unread,
Feb 24, 2010, 5:42:15 AM2/24/10
to Firebug
Hi guys,

I have a similar problem. After upgrading to firebug 1.5.2 (but also
downgrading to 1.5.0), in a jquery axaj response that should be a json

one, firebug interpreted it as XML so it gave an error about invalid


XML, and from that moment, the firebug console didn't work anymore (I
have to restart firefox).

Thank you in advance for your suggestions.

Marta

On 23 Feb, 17:43, Jim Biancolo <j...@biancolo.com> wrote:

John J Barton

unread,
Feb 24, 2010, 12:20:08 PM2/24/10
to Firebug

On Feb 24, 2:42 am, Marta <marta.lu...@gmail.com> wrote:
> Hi guys,
>
>   I have a similar problem. After upgrading to firebug 1.5.2 (but also
> downgrading to 1.5.0), in a jquery axaj response that should be a json
> one, firebug interpreted it as XML so it gave an error about invalid
> XML, and from that moment, the firebug console didn't work anymore (I
> have to restart firefox).
>
>   Thank you in advance for your suggestions.

Please check that all of your extensions are updated. If that does not
help, try Firebug in a new Firefox profile. See also

http://getfirebug.com/wiki/index.php/FAQ

jjb

Reply all
Reply to author
Forward
0 new messages