I included the standard jQuery Mobile CDN files on my index.html, and it applied the css to ALL of my pages. I don’t understand how/why that happens. Can someone explain? And is there a way to stop it?
<head>
<title></title>
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no;" />
<link rel="stylesheet" href="http://code.jquery.com/mobile/1.1.0/jquery.mobile-1.1.0.min.css" />
<script src="http://code.jquery.com/jquery-1.7.1.min.js"></script>
<script src="http://code.jquery.com/mobile/1.1.0/jquery.mobile-1.1.0.min.js"></script>
</head>
I can explain.
When you link pages with jQuery Mobile it doesn’t link directly to the new page. So that JQM can use it’s fancy page transitions it preloads the page and then swaps the old content with the new. Thus JQM will never reload the
<head>of the document.If you want to override this behaviour then put
rel="external"in your anchor tags. This tells JQM that it is linking to an external site, not a JQM page.