Javascript &引用;未终止的字符串文字;在FireFox控制台日志中?

Javascript &引用;未终止的字符串文字;在FireFox控制台日志中?,javascript,Javascript,我不明白为什么它会在Firefox控制台日志中显示错误消息。当我加载login.php页面时,它会向我显示一条错误消息,如下所示: SyntaxError: unterminated string literal var rie = '7c5c0f66034a105055511059115603131907460d511059095b1c4c414c6 如果我删除以下脚本,则它不会显示任何错误消息。所以我相信这都是关于以下脚本问题。你能告诉我为什么会出现这个错误消息吗?因为我是Javascri

我不明白为什么它会在Firefox控制台日志中显示错误消息。当我加载login.php页面时,它会向我显示一条错误消息,如下所示:

SyntaxError: unterminated string literal
var rie = '7c5c0f66034a105055511059115603131907460d511059095b1c4c414c6
如果我删除以下脚本,则它不会显示任何错误消息。所以我相信这都是关于以下脚本问题。你能告诉我为什么会出现这个错误消息吗?因为我是Javascript新手。谢谢你的帮助

<script type="text/javascript">
 //Hide image on page load
$('#loaderAnim').hide();
$('#login_process').submit(function (event) {
    event.preventDefault();
    $('#loaderAnim').show(); // Show it before making ajax call
    $.ajax({
        type: 'POST',
        url: 'login_process.php',
        data: $(this).serialize(),
        dataType: 'json',
        success: function (data) {
            $('#loaderAnim').hide(); // Hide when done 
            $('#success').html('');
            $.each(data, function (key, value) {
                if (key !== 'error') {
                    $('#success').append('<p>' + value + '</p>');
                }
            });
            if (!data.error) {
                $('#hide').hide();
                setTimeout(function () {
                    $('input[type=submit]').attr('disabled', false);
                    window.location.href = "index.php";
                }, 2000);
            }
        }
    });
});
</script>

//页面加载时隐藏图像
$('#loaderAnim').hide();
$('#登录\处理')。提交(函数(事件){
event.preventDefault();
$('#LoaderName').show();//在进行ajax调用之前显示它
$.ajax({
键入:“POST”,
url:'login_process.php',
数据:$(this).serialize(),
数据类型:“json”,
成功:功能(数据){
$('#LoaderName').hide();//完成后隐藏
$('#success').html('');
$。每个(数据、函数(键、值){
如果(键!=“错误”){
$('success')。追加('p>'+value+'

'); } }); 如果(!data.error){ $('#hide').hide(); setTimeout(函数(){ $('input[type=submit]').attr('disabled',false); window.location.href=“index.php”; }, 2000); } } }); });
更新(login.php页面):

<?php
ob_start();
session_start();
require_once("config.php");
if(isset($_SESSION['front_username']) && isset($_SESSION['front_password']) && isset($_SESSION['user_id'])){
header('Location:users/index.php');
exit();
}
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title><?php echo SITE_NAME; ?></title>
<link href="style/design.css" rel="stylesheet" type="text/css" />
<link href="style/menu-front.css" rel="stylesheet" type="text/css" />
</head>
<body>
<?php require_once("notice.php"); ?>
<div id="wraper">
    <div id="container">
        <div id="content">

<?php require_once("menu.php"); ?>

<h2>Login to manage your contacts.</h2>
<img id="loaderAnim" src="images/loading-image.gif" style="display:none;"/>
    <div id="success"></div>
    <form id="login_process">
    <table width="500" border="0" cellspacing="0" cellpadding="0">
      <tr>
        <td>Username</td>
        <td><input type="text" name="front_username" placeholder="Username" maxlength="20" /></td>
      </tr>
      <tr>
        <td>Password</td>
        <td><input type="password" name="front_password" placeholder="Password" maxlength="20"/></td>
      </tr>
      <tr>
        <td>&nbsp;</td>
        <td><input type="submit" name="submit" value="LogIn" class="submit"></td>
      </tr>
      <tr>    
        <td colspan="2">Forgot your password ? Click <a href="forgotpass.php">here.</a></td>
      </tr>
    </table>
    </form>

<script src="http://code.jquery.com/jquery-1.9.0.js"></script>
<!--<script src="include/function.js" type="text/javascript"></script>-->

<script type="text/javascript">
//Hide image on page load
$('#loaderAnim').hide(); 

$('#login_process').submit(function(event) {
event.preventDefault();

$('#loaderAnim').show(); // Show it before making ajax call
$.ajax({
type: 'POST',
url: 'login_process.php',
data: $(this).serialize(),
dataType: 'json',      

success: function (data) {
   $('#loaderAnim').hide(); // Hide when done 
   $('#success').html('');
   $.each( data, function( key, value ) {

    if(key !== 'error') {
            $('#success').append('<p>'+value+'</p>');           

    }  
}); 


    if( ! data.error) {     
        $('#hide').hide();              
         setTimeout(function () {
         $('input[type=submit]').attr('disabled', false);        
           window.location.href = "index.php"; 
    },     2000); 
        }

   }
});

});

</script>


<?php require_once("include/footer.php"); ?>


        </div><!--content-->
    </div><!--container-->
</div><!--wraper-->

</body>
</html> 

登录以管理您的联系人。
用户名
密码
忘记密码了?点击
//页面加载时隐藏图像
$('#loaderAnim').hide();
$('#登录\处理')。提交(函数(事件){
event.preventDefault();
$('#LoaderName').show();//在进行ajax调用之前显示它
$.ajax({
键入:“POST”,
url:'login_process.php',
数据:$(this).serialize(),
数据类型:“json”,
成功:功能(数据){
$('#LoaderName').hide();//完成后隐藏
$('#success').html('');
$。每个(数据、函数(键、值){
如果(键!=“错误”){
$('success')。追加('p>'+value+'

'); } }); 如果(!data.error){ $('#hide').hide(); setTimeout(函数(){ $('input[type=submit]').attr('disabled',false); window.location.href=“index.php”; }, 2000); } } }); });
我在您的脚本中根本看不到这个片段。看起来要么是
数据:$(this).serialize()
,要么(更有可能)是在jQuery解析ajax调用json的结果时。您能否使用Dev Tools中的Network选项卡检查ajax调用的原始响应,以查看其中是否存在类似于长哈希的内容?Firefox控制台日志上显示了此错误消息。错误应指向脚本和位置。请告诉我们更多。我是指错误消息的细节。此外,我们需要看到浏览器接收的HTML,而不是生成它的PHP。