也许你们专家的回答很快,但我遇到了一个有趣的挑战,我无法完全理解。在
我有一个python.psp文件,它包含一个listmylist[],它在运行时被填充,另一个javascript函数期望一个列表动态地创建一个表单对象,并在用户单击按钮时发送它。按钮是有原因的,因为它是运行时生成的表的一部分。每一行包含一组不同的项目,这些项目是从它自己的myList[]我想将rowsmyList[]列表传递给javascript函数,基本上是如果用户单击按钮的话。在
下面是我的一些代码来帮助说明:
Javascript代码:
function post(path, paramaters, method) {
method = method || "post";
var form = document.createElement("form");
form.setAttribute("method", method);
form.setAttribute("action", path);
for(var key in parameters){
var hiddenField = document.createElement("input");
hiddenField.setAttribute("type", "hidden");
hiddenField.setAttribute("name", key);
hiddenField.setAttribute("value", parameters[key]);
form.appendChild(hiddenField);
}
//create form and submit
document.body.appendChild(form);
form.submit();
}
使用mod\upython的python服务器页面(PSP)
^{pr2}$上传.psp期望列表中的四项….
谢谢你在这个问题上的帮助。在
-吉姆
试试这个:
相关问题 更多 >
编程相关推荐