jquery - How do I get the Full URL from SPListItem (curren item)? -
this code, don't know field url. can url different way?
var f = "<viewfields>"+ '<fieldref name="title"/>'+ '<fieldref name="linkfilenamenomenu"/>'+ '<fieldref name="created"/>'+ "</viewfields>";
it easy, hard find.
var f = "<viewfields>"+ '<fieldref name="id"/>'+ '<fieldref name="title"/>'+ '<fieldref name="linkfilenamenomenu"/>'+ '<fieldref name="created"/>'+ '<fieldref name="encodedabsurl"/>'+ "</viewfields>"; $().spservices({ operation: "getlistitems", async: false, listname: list, camlviewfields: f, camllimit: l, camlquery: q, completefunc: function (xdata, status) { $(xdata.responsexml).spfilternode("z:row").each(function() { var url = $(this).attr("ows_encodedabsurl") }); } });
it works in c# code, can use ows_encodedabsurl metadata value:
using (spsite site = new spsite(weburl)) { using (spweb web = site.openweb()) { splist list = web.lists["shared documents"]; splistitem item = list.items[0]; string itemurl = item["ows_encodedabsurl"].tostring(); } }
Comments
Post a Comment