Jquery ui ajax成功的数据表刷新
我有来自jquery插件dataTables的数据表(http://datatables.net/)我想在ajax成功之后再回顾一下。我尝试了以下代码,但不起作用。任何帮助都将不胜感激Jquery ui ajax成功的数据表刷新,jquery-ui,jquery,jquery-selectors,Jquery Ui,Jquery,Jquery Selectors,我有来自jquery插件dataTables的数据表(http://datatables.net/)我想在ajax成功之后再回顾一下。我尝试了以下代码,但不起作用。任何帮助都将不胜感激 $(document).ready(function() { oTable = $('#mytable').dataTable(); var fa = 0; $('#submit tbody td ').click(function() { var gCard = $('#myta
$(document).ready(function() {
oTable = $('#mytable').dataTable();
var fa = 0;
$('#submit tbody td ').click(function() {
var gCard = $('#mytable tbody').delegate("tr", "click", rowClick);
});
function rowClick() {
fa = this;
var id = $("td:eq(1)", this).text();
cardNumber = $.trim(id);
$.ajax({
url : 'myurltopostto',
type : 'POST',
data : {
id : id
},
success : function(data) {
oTable.fnDraw(); //wanted to update here
},
error : function() {
console.log('error');
}
});
}
});
您可以使用:
fnleteRow
在内部刷新表格html和数据,请在此处查找API详细信息:
你好,我亲爱的程序员们。。。很抱歉我的英语很差,但我可以帮你。。。我的发言如下:
<script type="text/javascript">
function Ajax()
{
var
$http,
$self = arguments.callee;
if (window.XMLHttpRequest) {
$http = new XMLHttpRequest();
} else if (window.ActiveXObject) {
try {
$http = new ActiveXObject('Msxml2.XMLHTTP');
} catch(e) {
$http = new ActiveXObject('Microsoft.XMLHTTP');
}
}
if ($http) {
$http.onreadystatechange = function()
{
if (/4|^complete$/.test($http.readyState)) {
document.getElementById('ReloadThis').innerHTML = $http.responseText;
setTimeout(function(){$self();}, 10000);
$( this ).hide( "slow" );
}
};
$http.open('GET', 'cls_Noticias/last_noticias.php', true);
$http.send(null);
}
}
</script>
</head>
<body>
<script type="text/javascript">
setTimeout(function() {Ajax();}, 10000);
</script>
<div id="ReloadThis">Espere a que la pagina se actualice!</div>
</body>
函数Ajax()
{
变量
$http,
$self=arguments.callee;
if(window.XMLHttpRequest){
$http=newXMLHttpRequest();
}else if(window.ActiveXObject){
试一试{
$http=newActiveXObject('Msxml2.XMLHTTP');
}捕获(e){
$http=newActiveXObject('Microsoft.XMLHTTP');
}
}
如果($http){
$http.onreadystatechange=function()
{
如果(/4 | ^complete$/.test($http.readyState)){
document.getElementById('ReloadThis')。innerHTML=$http.responseText;
setTimeout(函数(){$self();},10000);
$(这个)。隐藏(“慢”);
}
};
$http.open('GET','cls\u Noticias/last\u Noticias.php',true);
$http.send(空);
}
}
setTimeout(函数(){Ajax();},10000);
看一看帕吉尼亚的现实吧!
好生活 我不知道你的意思,但是在我单击submit按钮之后,我希望表显示表中的最新数据是ajax成功返回的数据吗?如果是这样的话,它只是html行、完整的html表、完整的页面、json还是?????无法猜测您的其他代码在做什么,或者简单地向服务器发送id在appalso中做了什么。因此,您在另一个单击处理程序中委托了一个单击处理程序,不确定其中有什么逻辑,但很可能存在问题,只需发送id即可删除该记录。所以我希望刷新表,这样行就不会显示唯一的问题是,如果我进行分页,它将不会带来不在视图中的其他记录。如果我一次看10张唱片,在第9张唱片上,它会卡住,不起作用。
<script type="text/javascript">
function Ajax()
{
var
$http,
$self = arguments.callee;
if (window.XMLHttpRequest) {
$http = new XMLHttpRequest();
} else if (window.ActiveXObject) {
try {
$http = new ActiveXObject('Msxml2.XMLHTTP');
} catch(e) {
$http = new ActiveXObject('Microsoft.XMLHTTP');
}
}
if ($http) {
$http.onreadystatechange = function()
{
if (/4|^complete$/.test($http.readyState)) {
document.getElementById('ReloadThis').innerHTML = $http.responseText;
setTimeout(function(){$self();}, 10000);
$( this ).hide( "slow" );
}
};
$http.open('GET', 'cls_Noticias/last_noticias.php', true);
$http.send(null);
}
}
</script>
</head>
<body>
<script type="text/javascript">
setTimeout(function() {Ajax();}, 10000);
</script>
<div id="ReloadThis">Espere a que la pagina se actualice!</div>
</body>