以前我从这里使用 JQuery 库 http://jquery.com/download/
http://code.jquery.com/jquery-migrate-1.2.1.min.js
我尝试包含以下代码,它运行良好。
Javascript
$(document).ready(function(){
function loading_show(){
$('#loading').html("<img src='images/loading.gif'/>").fadeIn('fast');
}
function loading_hide(){
$('#loading').fadeOut('fast');
}
function loadData(page){
loading_show();
$.ajax
({
type: "POST",
url: "listcontact.php",
data: "page="+page,
success: function(msg)
{
$("#con").ajaxComplete(function(event, request, settings)
{
loading_hide();
$("#con").html(msg);
});
}
});
}
loadData(1); // For first time page load default results
$('#con .pagination li.active').live('click',function(){
var page = $(this).attr('p');
loadData(page);
});
$('#go_btn').live('click',function(){
var page = parseInt($('.goto').val());
var no_of_pages = parseInt($('.total').attr('a'));
if(page != 0 && page <= no_of_pages){
loadData(page);
}else{
alert('Enter a PAGE between 1 and '+no_of_pages);
$('.goto').val("").focus();
return false;
}
});
});
HTML
<div id="con">
<div class="data"></div>
<div class="pagination"></div>
</div>
然后我尝试使用来自 Google 的 JQuery js,而不是来自 JQuery.com https://developers.google.com/speed/libraries/devguide#jquery
ajax.googleapis.com/ajax/libs/jquery/1.10.1/jquery.min.js
Tab 菜单仍然可以工作,但是我无法从 listcontact.php 获取任何数据
如何使它在 Google JQuery 中工作?
这是我所有的脚本标签
<script src="jquery-1.9.1.js"></script>
<script src="http://code.jquery.com/ui/1.10.3/jquery-ui.js"></script>
<script type="text/javascript" src="ajax.googleapis.com/ajax/libs/jquery/1.10.1/jquery.min.js"></script>
这是我的标签菜单
<nav>
<div id="tabs">
<ul>
<li><b><a href="#tabs-1">More Details</a></b></li>
<li><b><a href="#tabs-2">Contact</a></b></li>
<li><b><a href="#tabs-3">Files</a></b></li>
<li><b><a href="#tabs-4">Sales pipeLine</a></b></li>
<li><b><a href="#tabs-5">Call report</a></b></li>
</ul>
<div id="tabs-1">
<?php //include('viewdetail.php') ;?>
</div>
<div id="tabs-2">
<?php
if( $view == 0)
{
include('contact.php');
}
else
{
include('newcontact.php') ;
}
?>
</div>
<div id="tabs-3">
<?php //include('filemanagement.php') ;?>
</div>
<div id="tabs-4">
Under Development
</div>
<div id="tabs-5">
<?php //include('callReport.php') ;?>
</div>
</div>
</nav>
代码在我的联系页面中,当我尝试将其包含在我的选项卡中时