Javascript/jquery 适用于除 firefox 之外的所有浏览器

标签 javascript jquery asp.net-mvc-3 firefox

此代码适用于 IE8、Crome 和 Safari,但不适用于 firefox:

<script src="@Url.Content("~/Scripts/jquery-1.5.1.min.js")" type="text/javascript"></script>
<script src="@Url.Content("~/Scripts/modernizr-1.7.min.js")" type="text/javascript"></script>
<script type="text/jscript">
        alert("wazzup");
        $(document).ready(function () {

            $(".MathLink").hover(function () {
                $(this).css("color", "#d7d7d7");
            }, function () {
                $(this).css("color", "#FFFFFF");
            });

            $("#betyg_textblock").click(function () {
                window.open("http://hogrebetyg.se/");
            })

            $("#roids_textblock").click(function () {
                window.open("http://www.kongregate.com/games/irradiance_se/roids?acomplete=roids");
            })

            $(".servicesDiv").mouseenter(function (event) {

                if ($(this).css("height") == "45px") {
                    $(".servicesDiv").animate({
                        height: "45px"
                    }, 300);

                    $(this).animate({
                        height: "100px"
                    }, 300, function () {
                        $(".servicesDiv").clearQueue();
                    });
                }
            });

            $(".news").click(function (event) {
                if ($(this).css("height") == "53px") {
                    $(this).animate({
                        height: "100%"
                    }, 400, function () {
                        $(".news").clearQueue();

                    });
                }
                else {
                    $(this).animate({
                        height: "53px"
                    }, 400, function () {
                        $(".news").clearQueue();

                    });
                }
            });
        });
    </script>

我不知道为什么。请帮忙。

最佳答案

请参阅以下内容:

文本/javascript

歌剧 7.54+

IE 5+

火狐 1.0.7+

Safari 2.0.3+

iCab 3 测试版 394

卡米诺 2006021400

文本/jscript

歌剧 7.54+

IE 5+

Safari 2.0.3+

改成 text/javascript

引用:http://sachabarber.net/?p=824http://krijnhoetmer.nl/stuff/javascript/mime-types/

例如

<script type="text/jscript"> /*Code*/ </script>

<script type="text/javascript"> /*Code*/ </script>

关于Javascript/jquery 适用于除 firefox 之外的所有浏览器,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/6760193/

相关文章:

javascript - 正则表达式 - 12/22

javascript - 当跟随侧边栏到达页脚时如何停止?

performance - jQuery 全局事件和性能?

c# - ASP.Net MVC : Localized texts with new line?

asp.net-mvc-3 - 无法验证用户时如何返回更详细的错误

javascript - 有没有办法使用正则表达式来执行相同的图像交换功能,而不管扩展名如何?

java - 在 GWT 中使用连字符

javascript - 来自 Node.JS(使用 express)服务器的跨域 jQuery.getJSON 在 Internet Explorer 中不起作用

javascript - 填写 4 个字符时自动切换到下一个输入字段

c# - ModelState.Clear 不工作