html - Default jQuery Mobile CSS styling won't apply, multiple browsers tested -


i'm trying play around , learn jquery mobile, can't basic css styling apply. referencing css link jquery mobile website, , connected internet (but have tried loading css locally html, still wouldn't apply)

here test code:

<!doctype html>     <html>     <head>     <meta charset="utf-8">     <title>2test</title>     <meta name="viewport" content="width=device-width, initial-scale=1">      <link rel="stylesheet" href="http://code.jquery.com/mobile/1.4.5/jquery.mobile-1.4.5.min.css" />      <script src="http://code.jquery.com/jquery-1.4.5.min.js"></script>     <script src="http://code.jquery.com/mobile/1.4.5/jquery.mobile-1.4.5.min.js"></script>     </head>      <body>    <div data-role="page">  <div id="header" data-role="header">      <h1>my photos</h1>  </div>    <article data-role="content">      <ul data-role="listview" data-filter="true">          <li>              <a href="#">              <h1>miniature doberman pincher</h1>                            <p>this happens when              friend brings dog studio.</p>              </a>          </li>          <li>              <a href="#">              <h1>gummy bears</h1>                            <p>three different poster boards...mirror reflection,              black background white highlights</p>              </a>          </li>      </ul>      </article>    <footer data-role="footer" data-position="fixed">      <nav data-role="navbar">          <ul>              <li><a href="#">home</a></li>              <li><a href="#">photos</a></li>              <li><a href="#">info</a></li>          </ul>      </nav>  </footer>  </div>      </body>      </html>

and here output on desktop chrome 45 (edit: screenshot old, images since removed):

enter image description here

and output on android device chrome 45 (access hosted site):

enter image description here

neither output shows expected "mobile-y" of jquery mobile's default styling.. missing?

i see following errors in console.

failed load resource: net::err_unknown_url_scheme http://code.jquery.com/jquery-1.4.5.min.js failed load resource:     server responded status of 404 (not found) jquery.mobile-1.4.5.min.js:3 uncaught typeerror: cannot set property 'mobile' of undefined 

i think caused jqm tring parse urls of local files , failing kills js. fix remove references local file paths , instead use relative paths.

actually looks of jqm paths may incorrect:

<!-- add link here --> <script src="http://code.jquery.com/mobile/1.4.5/jquery.mobile-1.4.5.min.js"></script> <!-- remove link here --> <!--  <script src="http://code.jquery.com/jquery-1.4.5.min.js></script> --> 

see jquery mobile getting started error need include jquery include before jqm or use bundle.

edit: have quite few problems. jqm lot more manipulation of dom/html may used , has more rigorous structure find other style frameworks. need think in terms of single page app. pages must defined within file .. think need review docs head around jqm is.

as per http://demos.jquerymobile.com/1.4.5/intro/

a page in jquery mobile consists of element data-role="page" attribute. within "page" container, valid html markup can used, typical pages in jquery mobile, immediate children of "page" divs data-role="header", class="ui-content", , data-role="footer". baseline requirement page page wrapper support navigation system, rest optional.

jqm can little confusing start out - page div absolutely required. may better off copying , pasting examples first , playing around examples, styling need wrap content inside page div ..

<div data-role="page"> ... </div> 

for working version of example without images see http://jsfiddle.net/shotgundriver/8mb0rzhy/


Comments

Popular posts from this blog

resizing Telegram inline keyboard -

command line - How can a Python program background itself? -

php - "cURL error 28: Resolving timed out" on Wordpress on Azure App Service on Linux -