Interesting Firebug error message

4 views
Skip to first unread message

scheurbert

unread,
Aug 30, 2008, 1:32:24 AM8/30/08
to Firebug
Hi all,

I'm trying to do some tricky schtick with JS, in particular I'm
loading up a bunch of 'remote' JS files within a JS file.

I'm using jQuery ('cos it's pretty damn cool) and in the 'remote' JS
pages I'm loading, in the call to load them I need to initiate an
eval( scriptcontents ) call in order to be able to initialise the JS
code within each file. Which is fine and dandy because it seems to
work.

The problem I get is that because in my 'remote' JS files there are
various prototype calls to enable global use of the functions within
the other JS files, Firebug always seems to return an error message
saying...

ob.toString is not a function
[Break on this error] undefined

(plus a location of the error, which on a 37 line HTML file it says
the error's occuring at line number count greater than that total)

... even though everything seems to be working correctly. If I comment
out the prototype calls, the error does not display and my fancy JS
stuff doesn't work properly (something to do with particular functions
being defined within one file and the other JS files won't be able to
access them -- it's a long story).

Anyone know the explanation as to why the script(s) all seem to work
fine (using Firefox 3.0.1 and Firebug 1.2.0) but this error still pops
up in Firebug? Alternatively, if anyone knows another method to load
and initialise remote JS files (within a JS file, not within an HTML
document) then I'm interested in hearing how you do it!

Kind regards,


Scheurbert

serializer

unread,
Sep 9, 2008, 12:09:10 PM9/9/08
to Firebug
I'm also getting this problem.

It's happening in the ASP.NET AJAX libraries, in particular when
working with Silverlight 2 beta 2.

Because I'm performing a partial-page postback and a Silverlight
control is being added to the page dynamically at that point, the
Silverlight.js files must be getting loaded using the same dynamic JS
linkage you describe. This is a feature of ASP.NET AJAX allowing
scripts to be automatically loaded when required. At this point I see
the error and the Silverlight object completely fails to load.

FCKeditor is failing in the same fashion.

Obviously both are fine if they appear on the page when it's first
loaded - but this isn't always the case.

Seems to be a pretty serious problem affecting a variety of JS
libraries.

Pete Hurst

John J Barton

unread,
Sep 9, 2008, 12:17:05 PM9/9/08
to Firebug
Please post an example of the code that gives the message. From what
you say, it sounds like you are reading JS code via AJAX and eval() to
compile it. That works all of the time. What is "ob"? What file does
it error point to?

serializer

unread,
Sep 9, 2008, 1:01:13 PM9/9/08
to Firebug
Now unable to reproduce. Also there was a bug in my Javascript which
was stopping the control working (this was displayed as an additional
error. I thought it was because the script wasn't being loaded. In
fact it was an unrelated error.)

Will post further if I see it again.

Pete

more_ambition_than_talent

unread,
Sep 19, 2008, 10:07:50 AM9/19/08
to Firebug
Hi,
I recently experienced the obstinate 'ob.toString' error while parsing
dynamically-generated external xhtml11 pages into Firebug 3.0.1 using
mootools on Vista..

One page loaded perfectly - but it's almost-identical twin, although
loading fully, produced the error.

Pasting the entire 'bad' page code into the 'good' page, and
commenting it all out STILL produced the error..

..and eventually removing the last fragment below removed the bug...

<!--head>
<link title="style" rel="stylesheet" type="text/css" href="style.css"
media="screen" />
<script type="text/javascript" src="some.js" charset="utf-8">
<script type="text/javascript" src="another.js" charset="utf-8"></
script>
<title>etc</title>
</head-->

..and replacing the missing '</script>' tag also solved the problem
EVEN THOUGH THE CODE IS COMMENTED OUT! Deeply weird...

Rich

John J Barton

unread,
Sep 19, 2008, 10:42:05 AM9/19/08
to Firebug
I bet the Firefox team would be keen to have a test case so they could
fix this.

On Sep 19, 7:07 am, more_ambition_than_talent <b...@parknet.co.uk>
wrote:
Reply all
Reply to author
Forward
0 new messages