I ve got a pretty strong knowledge of php, html & csss but i ve onlystart to dive into javascript & jQuery.
i m面临的问题是,我在一页上有一个表格,我想先加以验证,然后才提出2项jax要求;第一,将数据列入我数据库的表格;第二,在另一个表格上提出询问并返还结果。
我用提交“Handler”的方法,用提交“Ajax”申请,在我网页上更新一片结果。 当我在此之后或之前加上第二批“jax”电话时,似乎会打断......
www.un.org/spanish/ecosoc 我的问题是。 是否应该像以下那样,在提名者中发出2个亚x,如果是的话,那么,这样做的正确途径是什么,甚至更好的方式?
$("#contactform").validate({
rules: ...
submitHandler: function() {
// First to insert the contact details using input#firstname etc.
var firstname = $("#firstname").value();
var lastname = $("#lastname").value();
var contactString = firstname= + firstname + &lastname= + lastname;
$.ajax({
type: "POST",
url: "insertcontact.php",
data: quoteString,
success: function(server_response){
$( #yourquote ).html(server_response).show();
}
});
// Second use width & height submitted from previous page for processquote.php
var width = <?php echo json_encode($cleanpost[ width ]); ?>;
var height = <?php echo json_encode($cleanpost[ height ]); ?>;
var quoteString = width= + width + &height= + height;
$.ajax({
type: "POST",
url: "processquote.php",
data: quoteString,
success: function(server_response){
$( #yourquote ).html(server_response).show();
}
});
}
});
http://docs.jquery.com/Plugins/Validation”rel=“nofollow” jquery.validate.js accreditation plugin。 我的目标再次是,一旦有人用Ajax将其联络数据输入数据库,那么数据库就利用上页上提交的领域检索数字结果,以在网页上显示,而不进行复读。
你们能够给我的任何要点都会受到高度赞赏。
抢劫
<>光线> 学习 Java字和amp; 焦炭同时是这种好想法的 t头,一味混淆:this. Value = ;
with $(this.val( );
,如前2个变式声明所示,这是造成问题的原因! 感谢您的有益帮助,你将提供援助。