& lt; href>没有正确加载页面

<a href> is not loading the page properly

本文关键字:加载 lt href      更新时间:2023-09-26
<div id="expander-demo" class="ui-widget-content">
    <p>Snap! the overstrained line sagged down in one long festoon; the tugging log was gone.</p>
    <a href="index2.html" class="ui-btn ui-btn-inline ui-btn-b moreinfo">More Info..</a>
</div>

这个<a href="index2.html">没有正确加载页面。一旦我按下链接更多信息,页面index2.html的操作就不会发生。如果我再次刷新页面,操作就会正确地进行。

为什么会发生这种情况?

index2.html:

<!DOCTYPE html>
<html>
<head>
<title>Third Page</title>
<meta charset="iso-8859-15">
<meta name="viewport" content="width=device-width, initial-scale=1">
<!-- jQuery and jQuery mobile -->
<script src="js/jquery_2.1.0.min.js"></script>
<script src="js/jquery_mobile_1.4.2.js"></script>
<link rel="stylesheet" href="css/jquery.css" type="text/css"/>
<script src="js/jquery.mobile.swiper.js" type="text/javascript"></script>
</head>
<body>
<div data-role="page" data-swipeleft="Pages/page1.html">
<div data-role="header">
<h1>jQuery Simple Swiper Plugin Example</h1>
</div>
<!-- /header -->
<div data-role="content"><br>
<br>
<br>
<br>
<br>
<br>
<div align="center"> Swipe the page to see it in action.</div> </div>
<!-- /content --> 
</div>
<!-- /page -->
<script type="text/javascript">
  var _gaq = _gaq || [];
  _gaq.push(['_setAccount', 'UA-36251023-1']);
  _gaq.push(['_setDomainName', 'jqueryscript.net']);
  _gaq.push(['_trackPageview']);
  (function() {
    var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
    ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
    var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
  })();
</script>
</body>
</html>

您的url更改在javascript中,或浏览缓存,您可以尝试测试完整的url包括host/index2.html,删除浏览器的缓存或查看由浏览器生成的html源或添加一个按钮和javascript警报锚url

不确定这是否有助于解决问题,但是,也许可以尝试在此包装您的jQuery。

$( document ).ready(function() {
       //your code here
});