$ui.ajax,JQuery-ui/AJAX/POST question

The templates directory is at the same level as index.php, so ./ is acceptable.  Otherwise, I would see file can't be found errors in Apache.

Is there a way to put the ajax post within the

for the tab references?

Ok, I was able to grab generated source of the pages, so hopefully this will help.  Let me know if there is more you would like to see and I will see what I can come up with.

Here is the main page.

Device Dashboard

$('#dashboardTab').load('./templates/dashboard.tpl.php', function() {});

$('form').submit(function() {

var $theForm = $(this);

console.log($theForm);

$.ajax({

type : "POST",

url : "./templates/mtconfig.tpl.php",

data : $theForm.serialize(),

success : function(returnData) {

console.log("Form sent");

$("#mtConfigTab").html(returnData);

}

});

return false;

}); 

   
Serial NumberLast Check-InManage
1234562013-01-29 12:13:43
6543212013-01-29 12:24:48

$(function() {

$( "#tabs" ).tabs({

active: 0});

});

$('#dashboardTab').load('./templates/dashboard.tpl.php', function() {});

$('form').submit(function() {

var $theForm = $(this);

console.log($theForm);

$.ajax({

type : "POST",

url : "./templates/mtconfig.tpl.php",

data : $theForm.serialize(),

success : function(returnData) {

console.log("Form sent");

$("#mtConfigTab").html(returnData);

}

});

return false;

});

And here is the generated source if you click on one of the forms with name="form_man_1".  When you click the Manage button, it should switch you to the Device Config tab and use the POST to determine which device to display.

Device Dashboard

$(function() {

$( "#tabs" ).tabs({

active: 1});

});

$('form').submit(function() {

var $theForm = $(this);

console.log($theForm);

$.ajax({

type : "POST",

url : "./templates/mtconfig.tpl.php",

data : $theForm.serialize(),

success : function(returnData) {

console.log("Form sent");

$("#mtConfigTab").html(returnData);

}

});

return false;

});

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值