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

Javascript/jquery works in every browser except firefox

本文关键字:浏览器 firefox jquery 适用于 Javascript      更新时间:2023-09-26

此代码适用于IE8, chrome和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>

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

参见:

text/javascript

Opera 7.54+

IE 5+

Firefox 1.0.7+

Safari 2.0.3+

iCab 3 Beta 394

卡米诺2006021400

文本/jscript

Opera 7.54+

IE 5+

Safari 2.0.3 +

修改为 text/javascript

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

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

<script type="text/javascript"> /*Code*/ </script>
相关文章: