将函数调用到另一个类

时间:2017-09-07 18:09:21

标签: javascript php html mysql ajax

我有问题将变量传递给另一个文件,我已经意识到代码并且我找不到解决方案,它在函数中向我发送错误

  

的onclick = “极限();的javascript:AyudaTipos(2)”/>

功能

function limit (){


 $.ajax({
            url: 'Tipos.php',
            type: 'POST', // GET or POST
             data: {"acreedor":$("#acreedor").val(),"importe2":$("#importe2").val(),
            success: function(data) { // data is the response from your php script
                // This function is called if your AJAX query was successful
              alert(data);
            },
            error: function() {
                // This callback is called if your AJAX query has failed
                alert("Error! Funcion Limite Anual");
            }
             }
        });
        }

1 个答案:

答案 0 :(得分:0)

解决:

$(function(){


$('#help').click(function(){





    $.ajax({
        url: 'Tipos.php',
        type: 'POST', // GET or POST
         data: {"acreedor":$("#acreedor").val(),"importe2":$("#importe2").val()},
        success: function(data) { // data is the response from your php script
            // This function is called if your AJAX query was successful
          alert(data);
        },
        error: function() {
            // This callback is called if your AJAX query has failed
            alert("Error!nuevo");
        }
    });
});

});

谢谢