但是Ctr1+左键点击src可以导向到打开引入文件。

解决方案 »

  1.   

    我是看教程的啊,说4.X版本引入bootstrap.js就行了,这个里面自行判定是否引入
      

  2.   

    我重新引入了ext-all,就不报错了,哎教程上明明说这个是4.x版本只需引入bootstrap.js的
      

  3.   

    bootstrap.js中引用的ext-all.js的路径 有这个js吗?
      

  4.   

    (function() {
        var scripts = document.getElementsByTagName('script'),
            localhostTests = [
                /^localhost$/,
                /\b(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)(:\d{1,5})?\b/ // IP v4
            ],
            host = window.location.hostname,
            isDevelopment = null,
            queryString = window.location.search,
            test, path, i, ln, scriptSrc, match;    for (i = 0, ln = scripts.length; i < ln; i++) {
            scriptSrc = scripts[i].src;        match = scriptSrc.match(/bootstrap\.js$/);        if (match) {
                path = scriptSrc.substring(0, scriptSrc.length - match[0].length);
                break;
            }
        }    if (queryString.match('(\\?|&)debug') !== null) {
            isDevelopment = true;
        }
        else if (queryString.match('(\\?|&)nodebug') !== null) {
            isDevelopment = false;
        }    if (isDevelopment === null) {
            for (i = 0, ln = localhostTests.length; i < ln; i++) {
                test = localhostTests[i];            if (host.search(test) !== -1) {
                    isDevelopment = true;
                    break;
                }
            }
        }    if (isDevelopment === null && window.location.protocol === 'file:') {
            isDevelopment = true;
        }    document.write('<script type="text/javascript" charset="UTF-8" src="' + 
            path + 'ext-all' + (isDevelopment ? '-dev' : '') + '.js"></script>');
    })();
      

  5.   

    上面是bootstrap.js的源码,要保存bootstrap.js文件的路径的,然后再根据情况拼ext-all.js或者ext-all-debug.js的路径进行导入。我的这两个文件和bootstrap.js在同一个文件夹下面。我再源码第一行都添加了alert(),只有bootstrap.js加载了。