Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/php/286.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Php 请继续获取jQuery语法错误_Php_Jquery_Ajax - Fatal编程技术网

Php 请继续获取jQuery语法错误

Php 请继续获取jQuery语法错误,php,jquery,ajax,Php,Jquery,Ajax,我的代码一直工作得很完美,但从周四开始,我在firebug中发现了一个语法错误,uplodify不工作,错误如下: SyntaxError:缺少)在参数列表之后[在此错误上中断] })) jquery.min.js(第2行,第4列) 我不知道出了什么问题,它在jQuery上给出了错误,而不是在我的代码中。我用原来的代码替换了我修改过的代码,但是我仍然得到了这个错误。我正在使用谷歌链接,我将其降级为“如果它能正常工作”,但一次又一次没有出现同样的错误 下面是我使用jQuery的脚本 <?ph

我的代码一直工作得很完美,但从周四开始,我在firebug中发现了一个语法错误,uplodify不工作,错误如下:

SyntaxError:缺少)在参数列表之后[在此错误上中断]

}))

jquery.min.js(第2行,第4列)

我不知道出了什么问题,它在jQuery上给出了错误,而不是在我的代码中。我用原来的代码替换了我修改过的代码,但是我仍然得到了这个错误。我正在使用谷歌链接,我将其降级为“如果它能正常工作”,但一次又一次没有出现同样的错误

下面是我使用jQuery的脚本

<?php

/**
 * @author SiNUX
 * @copyright 2013
 */

include ('lId.php');
?>
<!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" />

<script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.9.0/jquery.min.js"></script>
<script type="text/javascript" src="Upl/jquery.uploadify.min.js"></script>

<script type="text/javascript">
$(function() {
    $(function() {
        $('#imgUpload').uploadify({
            'auto'     : false,
            'swf'      : 'Upl/uploadify.swf',
            'uploader' : 'Upl/uploadify.php',
            'height'   : 20,
            'width'    : 200,
            'fileTypeDesc' : 'Image Files',
            'fileTypeExts' : '*.gif; *.jpg; *.png',
    }
        // Put your options here
    });
});
</script>

<script type="text/javascript">
 $(document).ready(function(){
  $("#save_data").click(function(){
    var name  = document.getElementById("Name").value;
    var desc = document.getElementById("Descrip").value;
    var con = document.getElementById("ConInfo").value;

    var dataString = 'Name='+name+'&Descrip='+desc+'&ConInfo='+con;
    $.ajax({
      type:'POST',
      data:dataString,
      url:'AddPoiPro.php',
      success:function(data){
       if(data="Data inserted") {
          //alert("Data  Success");
          document.getElementById('msg').innerHTML= "<div style=\"background-color:#0F0; text-align:center; color: #060\">Data Saved</dive>";
          $('#msg').delay(1500).fadeOut();
        } else {
          //alert("Not Inserted");
          document.getElementById('msg').innerHTML= "<div style=\"background-color:#0F0; text-align:center; color: red\">Data Not Saved</div>";
          $('#msg').delay(1500).fadeOut();
        }
     } 
   });
  });
});
</script>

<link rel="stylesheet" type="text/css" href="Upl/uploadify.css" />

<title>AddPOI</title>
</head>

<body>
<form method="post" enctype="multipart/form-data" name="form1" id="form1">
  <p>
    <label for="poiid">ID :</label>
    <input type="text" name="poiid" id="poiid" readonly="readonly" style="width:70px;" value="<?php echo $tId; ?>" />
  </p>
  <p>
    <label for="Name">POI Name :</label>

    <input type="text" name="Name" id="Name" />
  </p>
  <p>
    <label for="Descrip" style="alignment-adjust:middle">POI Description :</label>
    <textarea name="Descrip" id="Descrip" cols="45" rows="5"></textarea>
  </p>
  <p>
    <label for="ConInfo">Contact Infomation :</label>
    <textarea name="ConInfo" id="ConInfo" cols="45" rows="5"></textarea>
  </p>
  <p>
    <label for="Img">POI Image</label>
    <input type="file" name="imgUpload" id="imgUpload" />
  </p>
  <p><div id="msg"></div></p>
  <p>  
  <div align="center">
    <input type="button" name="Submit" id="sendData" value="Submit" onclick="$('#imgUpload').uploadify('upload','*');" style="width:100px;" />
    <input type="reset" name="reset" id="reset" value="Rest Data" style="width:100px;" />
  </div>
  </p>
</form>
</body>
</html>

$(函数(){
$(函数(){
$('imgUpload')。上传({
“自动”:false,
'swf':'Upl/uploadify.swf',
'uploader':'Upl/uploadify.php',
身高:20,,
“宽度”:200,
'fileTypeDesc':'Image Files',
'fileTypeExts':'*.gif;*.jpg;*.png',
}
//把你的选择放在这里
});
});
$(文档).ready(函数(){
$(“#保存#数据”)。单击(函数(){
var name=document.getElementById(“name”).value;
var desc=document.getElementById(“Descrip”).value;
var con=document.getElementById(“ConInfo”).value;
var dataString='Name='+Name+'&descripp='+desc+'&ConInfo='+con;
$.ajax({
类型:'POST',
数据:dataString,
url:'AddPoiPro.php',
成功:功能(数据){
如果(data=“插入的数据”){
//警报(“数据成功”);
document.getElementById('msg').innerHTML=“数据已保存”;
$('#msg').delay(1500).fadeOut();
}否则{
//警告(“未插入”);
document.getElementById('msg').innerHTML=“数据未保存”;
$('#msg').delay(1500).fadeOut();
}
} 
});
});
});
阿德波伊

身份证件:
在这里:

$(函数(){
$('imgUpload')。上传({
“自动”:false,
'swf':'Upl/uploadify.swf',
'uploader':'Upl/uploadify.php',
身高:20,,
“宽度”:200,
'fileTypeDesc':'Image Files',
'fileTypeExts':'*.gif;*.jpg;*.png'//此处没有逗号。将中断旧IE
});//这里:

$(函数(){
$('imgUpload')。上传({
“自动”:false,
'swf':'Upl/uploadify.swf',
'uploader':'Upl/uploadify.php',
身高:20,,
“宽度”:200,
'fileTypeDesc':'Image Files',
'fileTypeExts':'*.gif;*.jpg;*.png'//此处没有逗号。将中断旧IE
})//你失踪了附近

};
            // Put your options here
添加它并尝试

<script type="text/javascript">
$(function() {
    $(function() {
        $('#imgUpload').uploadify({
            'auto'     : false,
            'swf'      : 'Upl/uploadify.swf',
            'uploader' : 'Upl/uploadify.php',
            'height'   : 20,
            'width'    : 200,
            'fileTypeDesc' : 'Image Files',
            'fileTypeExts' : '*.gif; *.jpg; *.png',
    });
        // Put your options here
    });
});
</script>

$(函数(){
$(函数(){
$('imgUpload')。上传({
“自动”:false,
'swf':'Upl/uploadify.swf',
'uploader':'Upl/uploadify.php',
身高:20,,
“宽度”:200,
'fileTypeDesc':'Image Files',
'fileTypeExts':'*.gif;*.jpg;*.png',
});
//把你的选择放在这里
});
});
您丢失了附近

};
            // Put your options here
添加它并尝试

<script type="text/javascript">
$(function() {
    $(function() {
        $('#imgUpload').uploadify({
            'auto'     : false,
            'swf'      : 'Upl/uploadify.swf',
            'uploader' : 'Upl/uploadify.php',
            'height'   : 20,
            'width'    : 200,
            'fileTypeDesc' : 'Image Files',
            'fileTypeExts' : '*.gif; *.jpg; *.png',
    });
        // Put your options here
    });
});
</script>

$(函数(){
$(函数(){
$('imgUpload')。上传({
“自动”:false,
'swf':'Upl/uploadify.swf',
'uploader':'Upl/uploadify.php',
身高:20,,
“宽度”:200,
'fileTypeDesc':'Image Files',
'fileTypeExts':'*.gif;*.jpg;*.png',
});
//把你的选择放在这里
});
});
我可以想出一个………删除上面代码中*.png之后的最后一个“,”可能会有所帮助

还有一个在上面的片段末尾缺少“;”

我可以想出一个………删除上面代码中*.png之后的最后一个“,”可能会有所帮助

另一个在上面代码段的末尾缺少“;”,而不是这个

   'fileTypeExts' : '*.gif; *.jpg; *.png',
}
使用此选项,将出现
);
缺失

   'fileTypeExts' : '*.gif; *.jpg; *.png'
});
而不是这个

   'fileTypeExts' : '*.gif; *.jpg; *.png',
}
使用此选项,将出现
);
缺失

   'fileTypeExts' : '*.gif; *.jpg; *.png'
});

你当时犯了个小错误

$(function() {
$('#imgUpload').uploadify({
    'auto'     : false,
    'swf'      : 'Upl/uploadify.swf',
    'uploader' : 'Upl/uploadify.php',
    'height'   : 20,
    'width'    : 200,
    'fileTypeDesc' : 'Image Files',
    'fileTypeExts' : '*.gif; *.jpg; *.png'
  }
 );    //Here you need to add this

})你当时犯了一个小错误

$(function() {
$('#imgUpload').uploadify({
    'auto'     : false,
    'swf'      : 'Upl/uploadify.swf',
    'uploader' : 'Upl/uploadify.php',
    'height'   : 20,
    'width'    : 200,
    'fileTypeDesc' : 'Image Files',
    'fileTypeExts' : '*.gif; *.jpg; *.png'
  }
 );    //Here you need to add this

}))

您需要的只是:

$(function() { // <---------------------------just one doc ready handler
    $('#imgUpload').uploadify({
        'auto'     : false,
        'swf'      : 'Upl/uploadify.swf',
        'uploader' : 'Upl/uploadify.php',
        'height'   : 20,
        'width'    : 200,
        'fileTypeDesc' : 'Image Files',
        'fileTypeExts' : '*.gif; *.jpg; *.png' //<-----removed ","
     }); //<--------------------------------------); added this
    // Put your options here
});

$(function(){/您需要的只是:

$(function() { // <---------------------------just one doc ready handler
    $('#imgUpload').uploadify({
        'auto'     : false,
        'swf'      : 'Upl/uploadify.swf',
        'uploader' : 'Upl/uploadify.php',
        'height'   : 20,
        'width'    : 200,
        'fileTypeDesc' : 'Image Files',
        'fileTypeExts' : '*.gif; *.jpg; *.png' //<-----removed ","
     }); //<--------------------------------------); added this
    // Put your options here
});

$(function(){//您缺少一个
就在
//将选项放在这里
您缺少一个
就在前面
//把你的选项放在这里
谢谢这帮了我怎么会错过那个谢谢你非常感谢这帮了我怎么会错过那个谢谢你非常感谢那是个错误我无法想象我看得太多了谢谢你。谢谢你那是个错误我无法想象我看得太多了谢谢你。