Android 将jquery mobile与jquery结合使用
大家好,我有以下代码Android 将jquery mobile与jquery结合使用,android,jquery,google-chrome,jquery-mobile,Android,Jquery,Google Chrome,Jquery Mobile,大家好,我有以下代码 <script type="text/javascript" src="/js/jquery-2.0.0.min.js"></script> <script src="/js/jquery.mobile-1.3.1.js" type="text/javascript"></script> 但由于某些原因,在Chrome和任何android系统上,它只会使页面崩溃,在底部我只会收到一条“正在加载”的消息 有人知道为什么吗
<script type="text/javascript" src="/js/jquery-2.0.0.min.js"></script>
<script src="/js/jquery.mobile-1.3.1.js" type="text/javascript"></script>
但由于某些原因,在Chrome和任何android系统上,它只会使页面崩溃,在底部我只会收到一条“正在加载”的消息
有人知道为什么吗
谢谢解决方案
不要将jQuery 2.0与jQuery mobile 1.3.1一起使用
jQuery Mobile被锁定到某个jQuery版本范围。仅使用jQuery 1.7到1.9.X
在你的实例中有几个错误
CSS应该在js文件和HTML标记丢失之前初始化。此外,包含页面的DIV必须具有数据角色=“page”
属性
编辑:
您的最终代码应该如下所示:
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="viewport" content="width=device-width,initial-scale=1" />
<link rel="stylesheet" type="text/css" href="http://code.jquery.com/mobile/1.3.1/jquery.mobile-1.3.1.css">
<script type='text/javascript' src='http://code.jquery.com/jquery-1.9.1.min.js'></script>
<script type="text/javascript" src="http://code.jquery.com/mobile/1.3.1/jquery.mobile-1.3.1.min.js"></script>
<title>Packer Forbes Communications</title>
</head>
<body>
<div id="pageHead" data-role="page">
<div id="logo"><img src="images/packerForbesLogo.jpg" width="226" height="106" alt="Packer Forbes" /></div>
<div id="socMedia"><a href="http://www.pmlive.com/pmhub/healthcare_public_relations/packer_forbes_communications" target="_blank"><img src="/images/socIconPM.jpg" width="35" height="40" alt="PMLive" /></a><a href="http://www.linkedin.com/company/packer-forbes-communications?trk=top_nav_home" target="_blank"><img src="/images/socIconIN.jpg" width="35" height="40" alt="LinkedIn" /></a><a href="https://twitter.com/PackerForbes" target="_blank"><img src="/images/socIconTW.jpg" width="35" height="40" alt="Twitter" /></a><a href="http://www.youtube.com/playlist?list=PL4D83CC0DD394EF97&feature=view_all" target=_"blank"><img src="/images/socIconYT.jpg" width="35" height="40" alt="YouTube" /></a></div>
<div id="mainNav" role="navigation">
<a href="#nav" title="Show navigation" class="mobileonly">Show navigation</a>
<a href="#" title="Hide navigation" class="mobileonly">Hide navigation</a>
<ul id="nav" class="clearfix">
<li><a href="/index.html" class="selected">Home</a></li>
<li><a href="/what-we-do/index.html">What We Do</a>
<ul>
<li><a href="/what-we-do/market-access/index.html">Market Access</a></li>
<li class="navIndent"><a href="/what-we-do/market-access/case-studies.html">Case Studies</a></li>
<li><a href="/what-we-do/pr/index.html">Public Relations</a></li>
<li class="navIndent"><a href="/what-we-do/pr/case-studies.html">Case Studies</a></li>
<li><a href="/what-we-do/medical-education/index.html">Medical Education</a></li>
<li class="navIndent"><a href="/what-we-do/medical-education/case-studies.html">Case Studies</a></li>
<li><a href="/what-we-do/digital/index.html">Digital</a></li>
<li class="navIndent"><a href="/what-we-do/digital/case-studies.html">Case Studies</a></li>
</ul>
</li>
<li><a href="/about-us/index.html">About Us</a>
<ul>
<li><a href="/about-us/awards.html">Awards</a></li>
<li><a href="/about-us/the-team.html">The Team</a></li>
<li><a href="/about-us/life-at-packer-forbes.html">Life at Packer Forbes</a></li>
<li><a href="/about-us/our-values.html">Our Values</a></li>
</ul>
</li>
<li><a href="/clients/index.html">Clients</a></li>
<li><a href="/news/index.html">News</a></li>
<li><a href="/careers/index.html">Careers</a>
<ul>
<li><a href="/careers/training.html">Training</a></li>
<li><a href="/careers/internships.html">Internships</a></li>
<li><a href="/careers/benefits.html">Benefits</a></li>
<li><a href="/careers/current-vacancies.html">Current Vacancies</a></li>
</ul>
</li>
<li><a href="/contact/index.html">Contact</a></li>
<li><a href="http://downloads.packerforbes.com" target="_blank">Download Centre</a></li>
</ul>
</div>
<div id="mainBanner"><a href="/news/index.html"><img src="images/twentyBanner.gif" alt="We Are Twenty!" width="400" height="80" border="0" class="homeBanner" /></a></div>
</div>
<div id="mainBody">
<div id="contentWrapper">
<p class="brandStrip"> </p>
<div id="mainColumn">
<!--<h1>Who We Are</h1>-->
<h2>What We Do</h2>
<div id="marketAccess"> <a href="/what-we-do/market-access/index.html"><img src="images/marketAccess.jpg" width="160" height="160" alt="Market Access" /></a>
<h3><a href="/what-we-do/market-access/index.html">Market Access</a></h3>
</div>
<div id="communications"> <a href="/what-we-do/pr/index.html"><img src="images/communications.jpg" width="160" height="160" alt="Communications" /></a>
<h3><a href="/what-we-do/pr/index.html">Public Relations</a></h3>
</div>
<div id="medicalEducation"> <a href="/what-we-do/medical-education/index.html"><img src="images/medicalEducation.jpg" width="160" height="160" alt="Medical Education" /></a>
<h3><a href="/what-we-do/medical-education/index.html">Medical Education</a></h3>
</div>
<div id="digital"><a href="/what-we-do/digital/index.html"><img src="images/digital.jpg" width="160" height="160" alt="Digital" /></a>
<h3><a href="/what-we-do/digital/index.html">Digital</a></h3>
</div>
<p class="firstParaHome">Packer Forbes is an award-winning independent healthcare communications consultancy, specialising in medical communications. Our integrated approach ensures that our clients benefit from a compelling fusion of bespoke market access, public relations, medical education and digital communications approaches, all built on insight developed from years of experience.</p>
<p class="dividerLong"><span class="dividerLongMore"><a href="/what-we-do/index.html">Find Out More»</a></span></p>
<p class="mobileindexorgslogos">
<a href="http://www.hca-uk.org/" target="_blank"><img src="images/logoHCA.jpg" width="102" height="109" alt="HCA" /></a>
<a href="http://www.emig.org.uk/" target="_blank" class="mobileindexorgslogosemig"><img src="images/logoEMIG.jpg" width="102" height="109" alt="EMIG" /></a>
<a href="http://www.investorsinpeople.co.uk/" target="_blank"><img src="images/logoIIP.jpg" width="121" height="109" alt="IIP" /></a>
<a href="http://www.abpi.org.uk/about-us/membership/Pages/general-affiliate-list.aspx#p" target="_blank"><img src="images/abpi_new.jpg" width="102" height="109" alt="IIP" /></a>
<div class="mobileclear"></div>
</p>
</div>
<div id="sideColumn"></div>
<p class="brandStrip"> </p>
</div>
</div>
<div id="pageFoot">
<ul>
<li>1.09 Harbour Yard, Chelsea Harbour, London, SW10 0XD</li>
<li>t: +44 (0)20 7036 8550</li>
<li>f: +44 (0)20 7036 8569</li>
<li><a href="mailto:healthmail@packerforbes.com">e: healthmail@packerforbes.com</a></li>
<li><a href="/contact/cookie-policy.html">cookie policy</a></li>
</ul>
<p>Registered office: Packer Forbes Communications Ltd, 1.09 Harbour Yard, Chelsea Harbour, SW10 0XD Registered number: 3753460 </p>
</div>
</body>
</html>
Packer福布斯通讯公司
- 1.09伦敦切尔西港海港码头,SW10 0XD
- 电话:+44(0)2070368550
- f:+44(0)2070368569
注册地址:Packer Forbes Communications Ltd,地址:SW10 0XD切尔西港海港1.09号,注册号码:3753460
我们所做的
Packer Forbes是一家屡获殊荣的独立医疗通信咨询公司,专门从事医疗通信。我们的综合方法确保我们的客户受益于定制市场准入、公共关系、医学教育和数字通信方法的令人信服的融合,所有这些都是基于多年经验形成的洞察力
如果您使用的是JQM 1.3.1,则可以使用这两个脚本文件
jQuery JavaScript库v1.9.1
jQuery Mobile 1.3.1
加载
消息错误
如果要隐藏此消息,请在加载后立即尝试使用此消息
$(document).ready(function() {
$('.ui-loader').hide();
});
如果这就是你的全部代码,那么这可能是你的预期行为。我下载并使用了1.8.2,但它仍然在使用,你还有什么想法吗?你已经放弃初始化jQuery Mobile css。只有这样,您的测试页面才会正确。我已经看过你的演示页面了。使用这个版本的js和css:不要尝试混合使用1.3.0测试版js和1.3.1。似乎我需要使用jquery.css来实现jquery.mobile。但是如果我使用jquery.css,它会把其他一切都搞糟,不过谢谢你告诉我你需要jquery Mobile做什么?我刚把我的jquery文件改成了你建议的那些,它还是一样的。我创建了一个演示页面来查看这里,所以,你不想要JQM风格?尝试删除[reset.css]文件并查看?加载消息错误是因为JQM添加了一条隐藏的加载消息,它将根据某个事件显示。是的,这确实消除了错误消息,但页面的其余部分仍然禁用jquery。我现在删除了所有css包含和所有其他javascript包含,所以我只有两个javascript包含,我仍然收到这个“加载”错误现在添加这个JQM css,