Jquery函数$ post不能在Ubuntu上运行

时间:2012-05-14 11:24:00

标签: html

我有一个奇怪的问题。我写了一个jquery寄存器和登录程序,它在windows上工作正常,但在linux ubuntu上不起作用。 $ .post函数不起作用,它什么都不做。 Firefox错误控制台为空。 我的代码的html部分:

<html>  
<head>  
        <title></title>  
        <meta http-equiv="Content-Type" content="text/html; charset=utf-8">  
        <link rel="stylesheet" href="template/login.css" type="text/css">  
        <script type="text/javascript" src="template/js/jquery.js"></script>  
        <script type="text/javascript" src="template/js/functions.js"></script>  
        <script type="text/javascript" src="template/js/loginfunct.js"></script>  
</head>  
<body>  
<form action="" method="post" id="loginform">  
        <table cellpadding="0" cellspacing="0" width="640" align="center" style="margin-top: 7px;margin-bottom:15px;">  
        <tr><td class="panel_top" valign="middle">  
                Login  
        </td></tr>  
        <tr><td class="panel_content" valign="top">  
                <table cellpadding="8" cellspacing="0" style="margin-top:10px; margin-bottom:18px;">  
                <tr><td align="left" valign="top">  

                        <input type="text" class="textbox" value="" name="email" style="margin-left:10px;color:#A3A3A3;" id="logemail">  
                </td><td align="left" valign="top">  
                        <input type="password" class="textbox" value="Your password" name="password" id="logpassword" style="color:#A3A3A3;">  
                </td><td align="left" valign="top">  
                        <input type="submit" class="submit_ok" value="" name="login">  
                </td></tr>  
                <tr><td colspan="2" align="right" style="padding:0">  
                        <a href="#" style="font-size: 12px;" id="forgot_passw">Lost password</a>&nbsp;&nbsp;  

                </td><td></td></tr></table>  
                </form>  
<div id="darkbg"></div>  
<div id="error_msg"></div>  
<script type="text/javascript" src="template/js/login.js"></script>  
</body>  
</html>

javascript部分(login.js):

$(function(){  
$("#loginform").submit(function() {  
        var logemailc = $("#logemail").val();  
        var logpasswordc = $("#logpassword").val();  
        $.post(virpath+'requests/login.php', {'email':logemailc,'password':logpasswordc},  
                function(response) {  
                        if(response == "baddata") {  
                                show_error("You entered a wrong password or email address. Please try again.");  
                                $("#logpassword").blur();  
                                $("#logemail").blur();  
                        } else if(response == "nouser") {  
                                show_error("Sorry, something went wrong. You entered a correct datas but your account is broken.");  
                                $("#logpassword").blur();  
                                $("#logemail").blur();  
                        } else if(response == "unchecked") {  
                                show_error("Your account isn't confirmed. Please click on the link which is in your mailbox.");  
                                $("#logpassword").blur();  
                                $("#logemail").blur();  
                        } else if(response == "deactive") {  
                                show_error("Your account is banned by an administrator.");  
                                $("#logpassword").blur();  
                                $("#logemail").blur();  
                        } else if(response == "ok") {  
                                document.location = virpath+'cp/';  
                        }  
                });  
        return false;  
});  
});  

show_error函数在functions.js文件中,它的工作原理不在于这个功能。 我用ALERT测试了我的javascript程序的所有部分,它工作正常,但不起作用$ .post函数。

0 个答案:

没有答案