I have changed my coding style with more complex projects to loading pages (And their embedded scripts) \"on demand\" recently. However, it is difficult to debug those scrip
As you have already mentioned, you can use //@ sourceURL
. Chrome doesn't seem to be supporting //@ sourceURL
for inline scripts. It does work on eval expressions. This HTML5 article on source maps gives more details about naming eval blocks and naming of any anonymous functions in your code.
Instead of using eval, you can try embedding a script tag or JSONP may be.