Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/javascript/409.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

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/asp.net-mvc/16.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
Javascript ReferenceError:未定义ajaxCall_Javascript_Html_Ajax - Fatal编程技术网

Javascript ReferenceError:未定义ajaxCall

Javascript ReferenceError:未定义ajaxCall,javascript,html,ajax,Javascript,Html,Ajax,我有点迷路了。。。我有一个网站,有很多AJAX调用。我尝试了一些JavaScript文本字段格式,但这太难处理了,所以我决定不使用它就恢复正常。但是现在我的Ajax调用都不起作用,我不知道为什么。。。我得到的只是这个错误: ReferenceError: name-of-the-call is not defined 这些调用位于“scripts.js”文件中,从一开始就包含在头文件中 这是我现在的标题,有一个上传脚本和一个在输入字段之间导航的箭头键 <head> <titl

我有点迷路了。。。我有一个网站,有很多AJAX调用。我尝试了一些JavaScript文本字段格式,但这太难处理了,所以我决定不使用它就恢复正常。但是现在我的Ajax调用都不起作用,我不知道为什么。。。我得到的只是这个错误:

ReferenceError: name-of-the-call is not defined
这些调用位于“scripts.js”文件中,从一开始就包含在头文件中

这是我现在的标题,有一个上传脚本和一个在输入字段之间导航的箭头键

<head>
<title>The title</title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<link rel="stylesheet" type="text/css" href="style.css" />
<link rel="stylesheet" type="text/css" href="/scripts/uploadify.css">
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js"></script>
<script type="text/javascript" src="/scripts/jquery.uploadify.min.js"></script>
<script type="text/javascript" src="scripts.js"></script>
<script type="text/javascript" src="/scripts/ajaxsubmit.js"></script>
    <script type="text/javascript">
        <?php $timestamp = time();?>
        $(function() {
            $('#file_upload').uploadify({
                'formData'     : {
                    'timestamp' : '<?php echo $timestamp;?>',
                    'token'     : '<?php echo md5('unique_salt' . $timestamp);?>'
                },
                'height'   : 25,
                'buttonText' : 'bla bla...',
                'onUploadSuccess' : function(file, data, response) {
                    document.getElementById("uploadedId").innerHTML+='<p style="margin: 0px;"><img width="25px" src="/img/success.png" /><b>' + data + '</b></p>';
                    var str = document.getElementById("uploadedFiles").value;
                    if(str == ""){
                        document.getElementById("uploadedFiles").value=data;
                    }else{
                        document.getElementById("uploadedFiles").value+=',' + data;
                    }
                },
                'swf'      : '/scripts/uploadify.swf',
                'uploader' : '/scripts/uploadify.php'
            });
        });
    </script>
    <script type="text/javascript">
        $(document).ready(function(){
            $('body').on('keyup', 'input', function(e){
                if(e.which==39)
                    $(this).closest('td').next().find('input').focus();
                else if(e.which==37)
                    $(this).closest('td').prev().find('input').focus();
                else if(e.which==40)
                    $(this).closest('tr').next().find('td:eq('+$(this).closest('td').index()+')').find('input').focus();
                else if(e.which==38)
                    $(this).closest('tr').prev().find('td:eq('+$(this).closest('td').index()+')').find('input').focus();
            });
        });
    </script>
</head>
有人能帮我吗?这里有什么问题吗


多谢各位

scripts.js中存在语法错误,导致我的所有函数都无法工作。修复后,一切恢复正常。

它认为一定是语法错误,但我找不到它……所以您使用jquery,而不使用jquery的ajax函数。。。。。这很奇怪,我在uploadify文件上传脚本中使用jQuery,但在ajax调用中不使用jQuery。到现在为止,这一切都很顺利。。。
function companyVatnr(str){

if (str.length==0)
  {
  document.getElementById("companysearch").innerHTML="";
  document.getElementById("companysearch").style.border="0px";
  return;
  }
if(str.length>7){
if (window.XMLHttpRequest)
  {// code for IE7+, Firefox, Chrome, Opera, Safari
  xmlhttp=new XMLHttpRequest();
  }
else
  {// code for IE6, IE5
  xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
  }
xmlhttp.onreadystatechange=function()
  {
  if (xmlhttp.readyState==4 && xmlhttp.status==200)
    {
    document.getElementById("companysearch").innerHTML=xmlhttp.responseText;
    document.getElementById("companysearch").style.border="1px solid #A5ACB2";
    }
  }
xmlhttp.open("GET","ajaxcompany.php?q="+str,true);
xmlhttp.send();
}
}