对象不支持属性或方法’selectbox’

我正在使用来自http://www.bulgaria-web-developers.com/projects/javascript/selectbox/的selectbox jQuery插件。

我在js文件中也有一个链接,其中包含以下代码:

function loadTeams() { var responseArray, optionsOutput = ''; $.ajax({ type: "GET", url: "/ajax/team", dataType: "json", success: function (response) { responseArray = response.array; for (var i = 0; i < responseArray.length; i++) { optionsOutput += '' + responseArray[i] + ''; } $("#teamSelect").find('option') .remove() .end() .append(optionsOutput); $("#teamSelect").selectbox({ speed: 100 }); }, error: function (xhr, ajaxOptions, thrownError) { $("#teamSelect").find('option') .remove() .end() .append(''); } }); 

}

这适用于IE以外的所有浏览器。 在那里,我得到:

SCRIPT438:Object不支持属性或方法’selectbox’globals.js,第38行字符4

这相当于以下行:

 $("#teamSelect").selectbox({ speed: 100 }); 

我甚至试过将整个jQuery插件js文件复制到globals.js戏剧性和丑陋的方法,我仍然得到错误。

是什么赋予了?

编辑 – 更新:我已经尝试将#teamSelect分配给var并调用var.selectbox ,但是我得到了同样的错误。

啊哈,问题是jQuery的selectbox插件(可能是jQuery本身)和Foundation 4之间的冲突。当我集成Foundation 4时,我按照他们网站上的示例进行了复制并粘贴在这个神秘的位:

  

这是加载zepto或jquery,然后我从Google CDN加载jquery。 删除此行并放置我的jQuery jQuery首先解决了冲突。