firebug-lite下载地址:https://getfirebug.com/releases/lite/latest/firebug-lite.tar.tgz
下载完后直接搭建在本地80端口上,我的80端口是php服务器,支持文件夹路由,所以直接把压缩包解压到www文件夹下
IE6~8都是在虚拟机中调试,要连接Ubuntu上的端口不能用localhost,需要先获取本地IP地址:
$ ifconfig
找到wlan0的ip,比如说是: 192.168.0.109
。所以在虚拟机中的访问地址是 localtion.hastname + location.port + $fire_path
因此需要动态写入scrtpt的src:
(function(ie) {
if (!ie) return;
var b = document.createElement("script");
b.setAttribute("type", "text/javascript");
b.setAttribute("src", "http://" + location.hostname + "/firebug-lite/build/firebug-lite.js");
document.getElementsByTagName("head")[0].appendChild(b)
}(!+"\v1"));
仅仅给IE调试使用,所以用 !+"\v1"
来判定是够是IE是最简单不过了。