【发布时间】:2011-05-18 15:13:40
【问题描述】:
如你所见,我是 jquery / javascript 的菜鸟,我需要将变量传递给 GET 或 POST 以形式编写,而 php 的结果需要传递给 jquery,我开始如下编写 smthing,但它没有工作。
请大家帮帮我
// id and settings for msg box
$("#registerin").click(function() {
$.msgbox("<p>In order to process your request you must provide the following:</p>", {
type : "prompt",
inputs : [
{type: "text",label: "Insert your Name:", value: "George", required: true},
],
buttons : [
{type: "submit", value: "OK"},
{type: "cancel", value: "Exit"}
]
}, // id and settings for msg box - end
function(name) {
// checking if name field has been set
if(name) {
// pass from field to php $_GET['name_php'] variable
$.get("form.php", {name_php: name },
**// rewriten**
function(data) {
if (data){
// inline the data creation/insertion
$.msgbox($('#textbox').html(data), {type: "info"});
} // if data end
}); // function data end
**// rewriten**
} // if name end
}); // function name end
}); // registerin click
【问题讨论】:
标签: php javascript jquery msgbox