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