JSON JavaScript超链接
如何使用JSON/JavaScript检索的日期创建超链接JSON JavaScript超链接,javascript,html,json,sharepoint,Javascript,Html,Json,Sharepoint,如何使用JSON/JavaScript检索的日期创建超链接 { "mData": "FileRef" } - here I would like to have a hyperlink instead only text value. 下面是我使用的JavaScript函数 <script type="text/javascript"> function LoadZipCodes(state) { var call = $.ajax({ url: _s
{ "mData": "FileRef" } - here I would like to have a hyperlink instead only text value.
下面是我使用的JavaScript函数
<script type="text/javascript">
function LoadZipCodes(state)
{
var call = $.ajax({
url: _spPageContextInfo.webAbsoluteUrl + "/_api/Web/Lists/GetByTitle('SharePointList')/items?$select=FileRef",
type: "GET",
dataType: "json",
headers: {
Accept: "application/json;odata=verbose"
}
});
call.done(function (data,textStatus, jqXHR){
$('#example').dataTable({
"bDestroy": true,
"bProcessing": true,
"aaData": data.d.results,
"aoColumns": [
{ "mData": "FileRef" }
]
});
});
call.fail(function (jqXHR,textStatus,errorThrown){
alert("Error retrieving Tasks: " + jqXHR.responseText);
});
}
</script>
函数加载ZipCodes(状态)
{
var call=$.ajax({
url:_spPageContextInfo.webAbsoluteUrl+“/_api/Web/Lists/GetByTitle('SharePointList')/items?$select=FileRef”,
键入:“获取”,
数据类型:“json”,
标题:{
接受:“application/json;odata=verbose”
}
});
call.done(函数(数据、文本状态、jqXHR){
$('#示例')。数据表({
是的,
“bProcessing”:正确,
“aaData”:数据d.结果,
“aoColumns”:[
{“mData”:“FileRef”}
]
});
});
call.fail(函数(jqXHR、textStatus、errorshown){
警报(“检索任务时出错:+jqXHR.responseText”);
});
}
您是否尝试过此{“mData”:“}
{“mData”:“}它不起作用…那么我不确定您想要实现什么。顺便说一下,您需要用一些实际值替换“some_link”。如果您能详细说明您的问题,这将是非常有帮助的。我的问题与此相关:我只需要在JS/JSON生成的表中显示值作为指向文档的超链接。我的意思是像SharePoint列表项这样的文档,例如超链接do文档:现在我只能以文本形式获取此链接,而无需单击选项。