On Jul 29, 3:28 am, conticreative <[email protected]> wrote:
> I have been trying to learn how to troubleshoot JS errors in Firebug
> and IE forever but I am really stumped and don;t know how to proceed.
>
> For instance, I have several Joomla sites where the default Mootools
> and JQuery files in Joomla throw errors in firebug and IE8. Now, these
> are the default JS files, not something I added and when I try to
> trace the error (which is at best obscure in both FB and IE) often I
> get to the Mootools or JQuery code but once I am there I have no idea
> on how to proceed. IN IE I often cannot even get there.
>
> Clearly, I am missing something big and I suspect that may be partly
> due to my ignorance in JS and the DOM. I know how they work, but I
> certainly cannot troubleshoot them.
>
> Now, the same was true for a lot of other stuff but usually I can
> research things and eventually they start making sense. JS
> troubleshooting, especially in IE has me completely stumped. If there
> was someone offering a course online I would take it.
>
> If any JS and DOM guru is reading this, I would love it if you point
> me in the right direction on where to start in understanding this. Do
> I need to take a tutorial on the DOM? Do I need more JS Knowledge
> (that'd be obvious, but I have 10 JS books and none really go into
> troubleshooting).
>
> Any help and pointers would be greatly appreciated.
I don't know JQuery or Mootools, but when this sort of error appears
in prototype.js, it is usually down to one of three causes:
1. You have passed an element which does not exist to the library
2. You are trying to operate on the DOM before it has finished loading
3. You are using a new or outlandish browser (eg IE8) and the library
does not work on it (yet).
1 is often caused by 2, and in Prototype, the recommendation is to
delay your javascript until the dom is loaded, by
document.observe('dom:loaded', function() {
... your code here ...
});
I imagine that jQuery has some similar arrangement.
The way to use Firebug to catch these problems is by putting a
breakpoint on where you call the library function (or set 'Break on
All Errors' if you can't find that) and look at the variables you are
passing. You will often find that you are passing something as null
which should be defined - again, often because the DOM hasn't
initialised yet. (It's also possible that running under Firebug might
make the problem go away, by upsetting the timing. That is another
indication that you need to wait for loading to complete).
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Firebug" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/firebug?hl=en
-~----------~----~----~----~------~----~------~--~---