简体   繁体   English

Javascript文件未显示在Firebug中

[英]Javascript files don't show up in Firebug

i am currently working on a simple javascript module system (similar to the node.js module system or requireJS). 我目前正在开发一个简单的javascript模块系统(类似于node.js模块系统或requireJS)。

To load javascript files that are required for a module i use the mootools request object: 要加载模块所需的javascript文件,请使用mootools请求对象:

var request = new Request({
    url: <url to javascript file>,
    method: 'get',
    onSuccess: function(jsFileContent) {
        var func = new Function(jsFileContent);
        var result = func();
        // ...
    }
}).send();

The code works fine so far. 到目前为止,代码工作正常。 My problem is that javascript files that are loaded this way don't show up in Firebug. 我的问题是,以这种方式加载的javascript文件不会显示在Firebug中。 So debugging of these files becomes hard because Firebug features like breakpoints cannot be used. 因此,由于无法使用断点之类的Firebug功能,调试这些文件变得很困难。

Is there any way to make this work with Firebug? 有什么办法可以使Firebug发挥作用吗? Or is there any other way to load other javascript files from javascript that work fine with Firebug? 还是有其他方法可以从与Firebug正常工作的javascript加载其他javascript文件?

Thanks 谢谢

我认为轻松做到这一点的唯一方法是添加脚本标签...我建议编写一个包装检查全局调试标志...如果调试标志处于打开状态,则通过脚本标签插入脚本(如果关闭则插入脚本)通过ajax

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM