Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/json/15.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
Json 从sharepoint列表中获取URL和标题并使标题可单击_Json_Sharepoint - Fatal编程技术网

Json 从sharepoint列表中获取URL和标题并使标题可单击

Json 从sharepoint列表中获取URL和标题并使标题可单击,json,sharepoint,Json,Sharepoint,我正在尝试在页面上打印sharepoint列表数据。我的列表只包含“标题”和“URL”列。我正在尝试从列表中获取标题,然后使标题可单击,这会将我重定向到列表列中的特定URL条目 函数onQuerySucceeded(发送方,参数){ var listItemInfo=''; var listEnumerator=collListItem.getEnumerator(); while(listEnumerator.moveNext()){ var oListItem=listEnumerator

我正在尝试在页面上打印sharepoint列表数据。我的列表只包含“标题”和“URL”列。我正在尝试从列表中获取标题,然后使标题可单击,这会将我重定向到列表列中的特定URL条目

函数onQuerySucceeded(发送方,参数){ var listItemInfo=''; var listEnumerator=collListItem.getEnumerator(); while(listEnumerator.moveNext()){ var oListItem=listEnumerator.get_current(); var urlolistitem=oListItem.get_item('URL').toString(); listItemInfo+='标题:'+''\n'; } //警报(urolistitem.toString()); document.getElementById('divListItems')。innerHTML+=listItemInfo.toString()+“
”;
}它正在运行。我正在发布脚本。请查看它以了解您的知识

函数onQuerySucceeded(发送方,参数){ var listItemInfo=''; var listEnumerator=collListItem.getEnumerator(); while(listEnumerator.moveNext()){ var oListItem=listEnumerator.get_current(); var titleName=oListItem.get_项目(“标题”); var urlolistitem=oListItem.get_item('URL').toString(); listItemInfo+='标题:'+''\n'; } //警报(urolistitem.toString()); var divListItems=document.getElementById('divListItems'); divListItems.innerHTML+=listItemInfo+“
”; }只是一个更新——变量urlolistitem完美地获取了URL。我已经在循环结束时为列表的最后一个URL条目应用了一个警报,它会给我一个具有最后一个URL的警报。我不知道为什么它没有将URL绑定到标题。