If you are familiar with debugging Javascript using FireFox's FireBug, then you may run into difficulty debugging dynamic script. Although you can set a breakpoint in the script the debugger never pauses on it.
You will need to add the statement 'debugger' to the area that you want to debug like this:
function junk(){
debugger;
var s = "test";
}
Hope that helps.