Javascript 神秘的404错误

Javascript 神秘的404错误,javascript,http-status-code-404,Javascript,Http Status Code 404,加载时,Firebug中会出现404错误 NetworkError: 404 Not Found - http://summer-festivals.cloudfoundry.com/undefined 我最好的猜测是,一些应该解析为图像、.js或.css文件的javascript变量未定义,但我不确定如何跟踪负责的代码。我将从使用非精简版的jQuery开始。如果您在Chrome中加载页面并打开开发者工具,您可以看到jQuery加载了/undefined资源。如果您使用的是非精简版本,那么在加

加载时,Firebug中会出现404错误

NetworkError: 404 Not Found - http://summer-festivals.cloudfoundry.com/undefined

我最好的猜测是,一些应该解析为图像、.js或.css文件的javascript变量未定义,但我不确定如何跟踪负责的代码。

我将从使用非精简版的jQuery开始。如果您在Chrome中加载页面并打开开发者工具,您可以看到jQuery加载了/undefined资源。如果您使用的是非精简版本,那么在加载资源的jQuery文件中设置断点以查找错误应该很容易。

如果在加载页面时打开了控制台,则可以在堆栈上看到错误:

 GET http://summer-festivals.cloudfoundry.com/undefined 404 (Not Found)
    f.extend.cleanjquery-1.7.1.min.js:4
    f.buildFragmentjquery-1.7.1.min.js:4
    f.fn.extend.domManipjquery-1.7.1.min.js:4
    f.fn.extend.appendjquery-1.7.1.min.js:3
    $.fn.extend.infiniteCarouselbundle-true_defer.js:562
    e.extend.eachjquery-1.7.1.min.js:2
    e.fn.e.eachjquery-1.7.1.min.js:2
    $.fn.extend.infiniteCarouselbundle-true_defer.js:428
    _optionshttp://summer-festivals.cloudfoundry.com/:452
    f.Callbacks.njquery-1.7.1.min.js:2
    f.Callbacks.o.fireWithjquery-1.7.1.min.js:2
    e.extend.readyjquery-1.7.1.min.js:2
    c.addEventListener.Bjquery-1.7.1.min.js:2

我认为问题在于这个代码
bundle-trued\u defer.js

// No tabs left to sho
this.activeTab_ = undefined;
加载所有图像后,最后加载的将是未定义的页面

改变这个

  if (tab.tab == this.activeTab_) {
    // Removing the current active tab
    if (this.tabs_[index]) {
      // Show the tab to the right
      this.activeTab_ = this.tabs_[index].tab;
    } else if (this.tabs_[index - 1]) {
      // Show a tab to the left
      this.activeTab_ = this.tabs_[index - 1].tab;
    } else {
      // No tabs left to sho
      this.activeTab_ = undefined;
    }

    this.setTabActive_(this.activeTab_);
  }


使用此选项,并验证是否有效。

接受image/png,image/*;q=0.8,*/*;q=0.5
是一个未成功加载的图像。我在网站上看不到任何缺失的图像,有没有办法获取加载失败的图像的名称?是的,但现在我找不到解决方案。调查。-1:逐个移除组件,直到找到为止。这称为调试。是的,已测试,并且是
InfiniteCarsel
。所以是InfiniteCarsel导致了问题?我测试了您的更改,但它没有解决问题。您上面发布的代码是谷歌地图的一部分。当我在本地运行应用程序时,主页甚至没有加载此代码,但我仍然看到错误
  if (tab.tab == this.activeTab_) {
    // Removing the current active tab
    if (this.tabs_[index]) {
      // Show the tab to the right
      this.activeTab_ = this.tabs_[index].tab;
    } else if (this.tabs_[index - 1]) {
      // Show a tab to the left
      this.activeTab_ = this.tabs_[index - 1].tab;
    } else {
      // No tabs left to sho
      this.activeTab_ = undefined;
    }

    if(this.activeTab_ !== undefined) {
        this.setTabActive_(this.activeTab_);
    }
  }