在jQuery中通过AJAX提交表单不起作用

时间:2022-11-24 12:43:41

I using following jQuery code to submit a form via AJAX.

我使用以下jQuery代码通过AJAX提交表单。

$(function(){
    $("#forma_upis").submit(function(){
        $.ajax({
            url:$(this).attr("action"),
            type:$(this).attr("method"),
            data:$(this).serialize(),
            success:function(data){

            $("#Formcontent").fadeOut('slow');
            /*$("#content").load("stranice/lista_upis.php");*/

            if(data==1)
                {
                    $("#content").load("stranice/lista_upis.php");
                }
                else
                {
                alert(data);
                    alert("Error!!!");
                }

            }


        });

        return false;
    });

})

This work on my PC but when I try this on my other PC it doesn't work and I get an error and dont send data.

这项工作在我的电脑上,但当我在我的另一台电脑上试用它时,它不起作用,我收到错误,不发送数据。

1 个解决方案

#1


0  

In your case you have to look some things, like:

在你的情况下,你必须看一些东西,如:

1) Are you you linking the JQuery library correctly in the other PC?

1)您是否正在其他PC中正确链接JQuery库?

2) In the other PC do you have the php file (stranice/lista_upis.php)?

2)在另一台PC上你有php文件(stranice / lista_upis.php)吗?

3) The server-side is working in the other PC?

3)服务器端是在另一台PC上工作?

Hope it helps...

希望能帮助到你...

#1


0  

In your case you have to look some things, like:

在你的情况下,你必须看一些东西,如:

1) Are you you linking the JQuery library correctly in the other PC?

1)您是否正在其他PC中正确链接JQuery库?

2) In the other PC do you have the php file (stranice/lista_upis.php)?

2)在另一台PC上你有php文件(stranice / lista_upis.php)吗?

3) The server-side is working in the other PC?

3)服务器端是在另一台PC上工作?

Hope it helps...

希望能帮助到你...