我尝试将iframe添加到标签页并向其发布一些数据。我想发帖,因为我知道GET参数限制,而在我的情况下,数据可能是任意大小。我是这样做的:
var iframe = document.createElement("iframe"),
tabpanel = Ext.getCmp("testTabPanel"),
tab,
form;
iframe.setAttribute("id", "testframe");
iframe.setAttribute("src", "page.php");
tab = tabpanel.add({
title: "Test",
contentEl:iframe
});
tabpanel.setActiveTab(tab);
form = Ext.getBody().createChild({
tag: "form",
cls: "x-hidden",
id: "form",
action: "page.php",
target: "testframe",
method: "POST"
});
form.createChild({
tag:"input",
type:"text",
cls:"x-hidden",
name:"data",
value:"somedata"
});
form.dom.submit();
但它不起作用。在page.php
我用
print_r($_POST);
它打印出空数组。