0

我正在编写一个 Worklight Hybrid 应用程序并在其中使用 jQuery Mobile。

的HTML:

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Insert title here</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0, user-scalable=0">
            <link rel="shortcut icon" href="images/favicon.png">
            <link rel="apple-touch-icon" href="images/apple-touch-icon.png">

            <link rel="stylesheet" href="jqueryMobile/jquery/jquery.mobile-1.3.1.css">
            <link rel="stylesheet" href="css/itemDetails.css">
            <script>window.$ = window.jQuery = WLJQ;</script>
            <script src="jqueryMobile/jquery/jquery-1.9.1.js"></script>
            <script src="jqueryMobile/jquery/jquery.mobile-1.3.1.js"></script>
            <script src="js/itemDetails.js"></script>

</head>
<body >
    <div data-role="page" id="detailsPage">
     <div data-role="header" id="itemDetailsNavBar">
     <a href="#leftPanel" data-role="ui-icon-list-panel" data-corners="false" id="listButtonLeft"></a>
     <h1>Item Details</h1>
     <a href="index.html" data-role="ui-icon-edit" data-corners="false" id="editButtonRight"></a>
     </div>
    </div> 

    <script src="js/initOptions.js"></script>
<script src="js/messages.js"></script>
<script src="modules/core/MenuPanel.js"></script>
</body>
</html>

CSS:

@CHARSET "UTF-8";


#itemDetailsNavBar
{
    background: #ffb400 !important;
    height: 44px;
    padding-top: 20px;
}

#listButtonLeft {
    background: transparent url("images/list.png");
    box-shadow: none;
    data-corners :"false";
    margin-top: 19px;
    border: none;    
}

#editButtonRight {
    background: transparent url("images/edit.png");
    box-shadow: none;
    data-corners :"false";
    margin-top: 15px;
    border: none;
}

在浏览器中预览时,我可以正确看到它:

在此处输入图像描述

但是当通过 Worklight Console 的 MBS 进行预览时,我得到的是:

在此处输入图像描述

4

1 回答 1

1

我从头部删除了 CSS 并将其添加到正文结束标记之前,并且在模拟器和 MBS 中一切似乎都运行良好。

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
    <html>
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <title>Insert title here</title>
    <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0, user-scalable=0">
    </head>
    <body >
        <div data-role="page" id="detailsPage">
         <div data-role="header" id="itemDetailsNavBar">
         <a href="#leftPanel" data-role="ui-icon-list-panel" data-corners="false" id="listButtonLeft"></a>
         <h1>Item Details</h1>
         <a href="index.html" data-role="ui-icon-edit" data-corners="false" id="editButtonRight"></a>
         </div>
        </div> 

   <link rel="stylesheet" href="css/itemDetails.css">
   <script src="js/itemDetails.js"></script>
   </body>
   </html>
于 2013-12-06T05:27:29.280 回答