John

On Thu, Oct 29, 2009 at 4:28 PM, John J Barton
<[email protected]> wrote:
>
>
> On Oct 29, 2:22 pm, Greg Hellings <[email protected]> wrote:
>> John,
>>
>> On Thu, Oct 29, 2009 at 3:59 PM, John J Barton
>>
>> <[email protected]> wrote:
>>
>> > On Oct 29, 10:16 am, Gregory Hellings <[email protected]> wrote:
>> > > I'm using Firebug to debug some JavaScript files that I've written.
>> > > However, a number of the scripts are dynamically loaded by my
>> > > original, static JavaScript files only if the user selects portions of
>> > > the page which require them.  This is using the jQuery.getScript()
>> > > method to do the fetch and execute.
>>
>> > To help I'd need to know that this function does under the covers.
>>
>> Without trying to replicate too much of their code and at risk of
>> showing you the wrong parts, it looks like it boils down to the
>> following primary lines:
>> var head = document.getElementsByTagName("head")[0];
>> var script = document.createElement("script");
>> script.src = s.url;
>> script.onload = script.onreadystatechange = function(){
>>        // Handle memory leak in IE
>>        script.onload = script.onreadystatechange = null;
>>        head.removeChild( script );
>>                         }
>> head.appendChild(script);
>>
>> Obviously, I greatly simplified that, but it appears to me to be the
>> main method calls during a call to jQuery.getScript().  In summary, in
>> case I butchered it too badly, it creates a script tag, appends it to
>> the header, points its source to the requested script and, on load,
>> removes it from the header.  The last behavior - removing it from the
>> header - would seem, to me, to be the reason that I can't find the
>> script to put breakpoints and traces on.
>
> If you are using a recent version of Firebug, this removeChild() will
> not cause a problem. Try Firebug 1.5xb1, 
> http://getfirebug.com/releases/firebug/1.5X.
> Let us know.
> jjb

I was running 1.4.3.  I updated to 1.5xb1.  Now I see the part of the
script.  My script creates an object which has a handful of methods in
it, and I can see each of the function definitions and their lines,
but any breakpoints I set in them are not giving me actual code
breaks, and I can't see the original code of the object.  The name
under which I found them is also listed as <current URL>/event rather
than the address of the script that was loaded at that event, which I
understand from a technical standpoint, but it makes it tough to
identify the script in question.

It's a step in the right direction over 1.4.3!  Thanks.

--Greg

>
>>
>> --Greg
>
> --
>
> 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.
>
>
>

--

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.


Reply via email to