Question

I am writing a Worklight Hybrid application and utilizing jQuery Mobile in it.

The 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>

The 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;
}

When previewing in a browser I see it properly:

enter image description here

But when previewing via Worklight Console's MBS, this is what I am getting:

enter image description here

Was it helpful?

Solution

I removed the CSS from the head and added it just before the body end tag and everything seems to work fine both in simulator and the 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>
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top