douteng5673 2012-03-27 10:34
浏览 62
已采纳

jquery ajax查询执行两次

i have form with user data to input and javascript ajax to send information on server and handle it with php to send this info on email, but when i submit, ajax send this informatio twice javascript:

$.ajax({
  type: "POST",
  url: "<?php echo JURI::root(). " / components / com_searchtour / handler.php " ?>",
  data: {
    'birthday': $("#birthday").val(),
    'name': $("#name").val(),
    'name2': $("#name2").val(),
    'name3': $("#name3").val(),
  },
  success: function(html) {
    $('div#text_after_submit').append("<h2>Отправлено</h2>");
  }
});
return false;

found the problem i have some code below this

$(function(){
                          $.datepicker.setDefaults(
                                $.extend($.datepicker.regional["ru"])
                          );

when i remove it, now all works fine :) thanks everyone for help

  • 写回答

2条回答 默认 最新

  • dongzhao2725 2012-03-27 10:43
    关注
    $.ajax({
      type: "POST",
      url: "<?php echo JURI::root(). " / components / com_searchtour / handler.php " ?>",
      data: {
        'birthday': $("#birthday").val(),
        'name': $("#name").val(),
        'name2': $("#name2").val(),
        'name3': $("#name3").val(),
      },
      success: function(html) {
        $('div#text_after_submit').append("<h2>Отправлено</h2>");
      }
    
      return false;
    });
    
    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(1条)

报告相同问题?