Debugging dynamically added Javascript code
Posted
by gilm
on Stack Overflow
See other posts from Stack Overflow
or by gilm
Published on 2010-05-09T12:59:32Z
Indexed on
2010/05/09
13:08 UTC
Read the original article
Hit count: 373
One of the programmers I worked with has something similar in code:
var head = document.getElementsByTagName("head")[0];
var e = document.createElement("script");
e.type = "text/javascript";
var b = "function moo() { alert('hello'); }";
e.appendChild(document.createTextNode(b));
head.appendChild(e);
moo();
This is all good and dandy, but I would like to step into moo(), and firebug just can't do that. I know I can rip the whole thing apart, but I reallllly don't want to touch it and his code works :)
Any ideas how I can debug this with Firebug?
Cheers
© Stack Overflow or respective owner