Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/javascript/389.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/2/jsf-2/2.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:UncaughtTypeError:n不是函数_Javascript_Jquery_Sharepoint_Error Handling - Fatal编程技术网

Javascript:UncaughtTypeError:n不是函数

Javascript:UncaughtTypeError:n不是函数,javascript,jquery,sharepoint,error-handling,Javascript,Jquery,Sharepoint,Error Handling,我找到了很多关于这个错误的文章,但看起来每个案例都很特殊,所以我无法给出很好的答案 所以我的代码应该是这样工作的: 查找列表ID中的特殊字段:101这是列中的唯一数字,因此只针对1个字段 从中获取号码 将该数字更新为数字+1 但是取而代之的是一个错误uncaughttypeerror:n不是一个函数,详细信息的目标是jquery.min.js和sharepointplus.min.js。我不能确定,但可能代码中基于sharepointplus的部分工作正常,因为我可以在其他代码中升级severe

我找到了很多关于这个错误的文章,但看起来每个案例都很特殊,所以我无法给出很好的答案

所以我的代码应该是这样工作的:

查找列表ID中的特殊字段:101这是列中的唯一数字,因此只针对1个字段

从中获取号码

将该数字更新为数字+1

但是取而代之的是一个错误uncaughttypeerror:n不是一个函数,详细信息的目标是jquery.min.js和sharepointplus.min.js。我不能确定,但可能代码中基于sharepointplus的部分工作正常,因为我可以在其他代码中升级severel字段

$(document).ready(function () 
{
  var ID=101;
  $SP().list("INNList", "http://.../sites/Registry/").get(
  {
    fields: "n1k8"
  },
  {
    where: 'INNnumber = '+Number(ID)
  }, alert("step1: "+Number(szam)),  //this alerts works
  function getData(info) //probably something wrong around here (alerts not works after this part)
  {
    for (var i = 0; i < info.length; i++)
    {
      $SP().list("INNList", "http://.../sites/Registry/").update(
      {
        n1k8: (Number(info[i].getAttribute("n1k8")) + Number("1"))
      },
      {
        where: 'INNnumber = '+Number(ID)
      });
    }
  });
});

我最近才开始使用javascript,所以它可能只是一个小错误。非常感谢您的建议

如果您对sharepointplus或任何其他第三方使用速记$,则不能对jQuery使用$

尝试用jQuery替换$

例如: 替换:$document
使用:jQuerydocument

可能是您引用这些js文件的顺序,而不是您的代码。多次引用同一js文件也可能导致问题。我的顺序是:1。jquery.min.js,2。jquery.SPServices-2014.02.min.js,3。sharepointplus-4.0.min.js。我的脚本中只有一个引用。我试图改变顺序,但似乎我得到了相同的错误。但是非常感谢你的想法!如果您有其他建议,请告诉我。如果您使用$sharepointplus或任何其他第三方,那么您不能使用$jQueryThank速记。非常感谢您的想法!我用:jQuerydocument更改了$document,但仍然得到了相同的错误:我的程序中还有其他代码,其中我对document和sharepointplus都使用了$document,但运行良好,因此可能还有其他代码。如果你有任何其他建议,让我知道,我会测试它。谢谢你的帮助!您引用的JS文件的顺序是什么?