jQuery Mobile和Internet Explorer完全不起作用

3
我知道IE 7-9是一级支持的。但对于我的网站来说,它无法正常工作,我无法确定为什么。这是链接:http://www.fuelingminds.com/userpages.cfm 我之前使用alpha 4完成了一些项目,一切看起来都很好,但现在我换成了beta 1。是否有已知的问题或者我在代码中漏了显而易见的东西?
注意:我尝试禁用ajax以查看是否是原因,但依然出现同样偏斜的外观。我已经在多台计算机上的IE 7和9上尝试过,并尝试使用本地源代替jquery mobile。
<html>
<head>
<link rel="stylesheet" href="http://code.jquery.com/mobile/1.0b1/jquery.mobile-1.0b1.min.css" />
<script src="http://code.jquery.com/jquery-1.6.1.min.js"></script>
<script src="http://code.jquery.com/mobile/1.0b1/jquery.mobile-1.0b1.min.js"></script>
<link href="css/loginandError.css" type="text/css" />
</head>
<body>
<div data-role="page" data-theme="c" id="login" data-ajax="false">
    <div data-role="header">
        <a onClick="window.history.back()" data-icon="back" data-direction="reverse" >back</a>
        <a href="index.cfm">home</a>
        <h1>Fueling The Future - Login</h1>
    </div>
    <div data-role="content" align="center">
        <form action="loginAct.cfm" method="post" data-ajax="false">
            <input type="text"  value="youremail@email.com" name="email">
            <input type="password" value="password" name="pass">
            <br>
            <input type="submit" value="login" name="login" data-inline="true">
            <br>
            <a href="" style="text-decoration:none;">Register To Apply Today!</a>
        </form>
    </div>
</div>


<!---        <div data-role="page" data-theme="c" id="register" data-ajax="false">
        <div data-role="header">
            <h1>Fueling The Future</h1>
            <!--<div data-role="navbar">
                <ul data-inset="true" style="margin-top: 0px; margin-bottom: 0px;"> 
                    <li><a href="">Home</a></li>
                    <li><a href="">The Program</a></li>
                    <li><a href="">Page 3</a></li>
                    <li><a href="">Page 4</a></li>
                    <li><a href="">Contact</a></li>       
                </ul>
            </div>-->
        </div>
        <div data-role="content">
            <cfform action="regAction.cfm" method="post" data-ajax="false">    
                <label for="email">E-mail</label>
                <cfinput type="text" label="E-mail" name="email" >           
                <label for="pass">password</label>
                <cfinput type="password" name="pass" >
                <label for="passChk">enter password again</label>
                <cfinput type="password" name="passChk" >                 
                <label for="fName">First Name</label>
                <cfinput type="text" name="fName">
                <label for="lName">Last Name</label>
                <cfinput type="text" name="lName">
                <br>
                <cfinput type="submit" name="submit" value="register" data-inline="true">
            </cfform>
        </div>
        <div data-role="footer">

        </div>
    </div>--->
</body>
</html>
3个回答

5
<meta charset="utf-8" http-equiv="X-UA-Compatible" content="IE=9" />
<!--[if IE 7]><meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no" /><![endif]-->
<!--[if IE]>

    <script src="http://html5shiv.googlecode.com/svn/trunk/html5.js"></script>
    <style type="text/css">
        .clear {
            zoom: 1;
            display: none;
        }
    </style>
<![endif]-->

将此粘贴到您的布局页面中


5

请问您使用的IE9浏览器能够正常打开这个页面吗?

如果可以,那么很遗憾这是jQuery Mobile的Alpha3版本,但也许这些修复方法适用于您:

// Fix for IE9 and experimental jQuery Mobile Datepicker
//customize jQuery Mobile to let IE7+ in (Mobile IE)
$(document).bind("mobileinit", function(){
    //reset type=date inputs to text
    $.mobile.page.prototype.options.degradeInputs.date = true;
    $.extend($.mobile, {
        //extend gradeA qualifier to include IE7+
            gradeA: function() {
                //IE version check by James Padolsey, modified by jdalton - from http://gist.github.com/527683
                    var ie = (function() {
                        var v = 3, div = document.createElement('div'), a = div.all || [];
                            while (div.innerHTML = '<!--[if gt IE '+(++v)+']><br><![endif]-->', a[0]);
                                return v > 4 ? v : !v;
                    }());
                    //must either support media queries or be IE7+
                    return $.support.mediaquery || (ie && ie >= 7);
            }
    });
});

您需要将这些代码行放置在query.js和query.mobile.js之间。


5

你需要添加<!DOCTYPE html>,否则它将无法正确读取HTML5。


我已经注意到忘记在这里进行更改了。我意识到问题来自服务器,我尝试在Linux服务器上运行它,结果在IE中全部呈现正常,但当我将相同的代码放在IIS上时,它在Internet Explorer中无法呈现,但在其他所有浏览器中都可以。 - rajh2504

网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接