0

我正在为这个人建立一个网站,他希望我安装 SoundCloud 自定义播放器。我这样做了,发现它在 Chrome 中运行良好,但在 FireFox(我在 19.0.2)或 IE(9.0.14)中不起作用。

这是网站: http: //kimmy.lareveuse.net/

我做错了什么吗?

我在这里得到了所有的安装信息:http: //developers.soundcloud.com/docs/custom-player#

该页面中的示例确实可以在 FireFox 上运行,但我注意到他们的示例使用的是以前版本的 jquery (1.4.2),而我们现在使用的是 1.9.0 版本

任何建议,将不胜感激。

4

2 回答 2

1

Always open you console when trying to debug JavaScript. For starters you have an error when trying to load some CSS file:

GET http://kimmy.lareveuse.net/css/sc-player.css 404 (Not Found)

This will not solve the problem, but you should fix it either way.

Secondly you should set the encoding of document:

The character encoding of the HTML document was not declared. The document will render with garbled text in some browser configurations if the document contains characters from outside the US-ASCII range. The character encoding of the page must to be declared in the document or in the transfer protocol.

Again this also will not solve the problem. The actual problem is that you are using jQuery 1.9 in which .browser is removed. And this is used by the custom soundcloud player to sniff the browser:

TypeError: $.browser is undefined [Break On This Error] if ($.browser.msie) {

So either you need to upgrade the soundcloud player script (if a newer version is available) or you need to downgrade your jQuery version.

于 2013-03-20T20:36:09.710 回答
0

这里有一个官方的“jQuery Migrate”插件:

http://code.jquery.com/jquery-migrate-1.1.0.min.js

您可以在正常的 jQuery 参考之后添加它。(通常不赞成,但可以快速解决。)如果做不到这一点,您需要摆脱 SC 的 $.browser.msie 用法并添加您自己的 IE 检测。

于 2013-03-22T15:30:08.567 回答