0
我正在使用jQuery选项卡(来自此示例:http://jqueryui.com/demos/tabs/#manipulation),并且希望添加一个包含来自外部源的内容的新选项卡。在获取数据之前,此外部源需要POST参数。来自外部源的结果应该创建并填充新选项卡,以在新选项卡上显示这些结果。jQueryUI选项卡 - 使用POST的新选项卡
$("#tabs").tabs({
ajaxOptions: {
error: function(xhr, status, index, anchor) {
$(anchor.hash).html("Unable to load content for this form. Please contact your web administrator");}
}
});
...
function addTab() {
$.post(
"/test.php", // External source URL
{ id: "11" }, // Sets POST data
function (data) {
$('#tabs').tabs("add", data, $tab_title); // should create a new tab with the results from the external source
}
);
}
我没有工作。其他人有这个设置的工作副本?
如果您使用GET,您将如何防止直接访问该页面? – Ourx 2012-02-21 04:56:25
POST在这个意义上并不使它更安全。 – 2012-02-21 06:36:16