jeudi 29 janvier 2015

hyperlink column in spservices



I am trying to get hyperlink type of column named as "Important Link". withoutvar liHtml5="



  • " + ($(this).attr("ows_Important_x0020_Link")).split(", ")[0]+"

  • "; other code works perfect. Please help. My SPservice code is as below:


$().SPServices({



operation: "GetListItems",
async: false,
listName: "URL_List",
CAMLQuery: "<Query><Where><Eq><FieldRef Name='Title'/><Value Type='text'>"+ URL+ "</Value></Eq></Where></Query>",
CAMLViewFields: "<ViewFields><FieldRef Name='Title'/></ViewFields>",
completefunc: function (xData, Status)
{
var itemCount = $(xData.responseXML).SPFilterNode("rs:data").attr("ItemCount");
alert(itemCount);
if(itemCount == 0)
{
//check if URL contains slash
var SlashTesing=URL.indexOf("/") != -1;
alert(SlashTesing);

if(SlashTesing== true)
{
NewURL=URL.substring(0,URL.lastIndexOf("/"));
gofunction(NewURL);
}
else
{
var liHtml2="<h2>"+"Sorry...we dont have this info "+"</h2>";
$("#tasksUL").append(liHtml2);
}
}
else
{
$(xData.responseXML).SPFilterNode("z:row").each(function()
{
var text="<h2>"+"Showing information for this URL :"+URL+"</h2>";
var liHtml2="<li>" + $(this).attr("ows_Department") + "</h4>"+"</li>";
var liHtml3="<li>" + $(this).attr("ows_Team") + "</h4>"+"</li>";
var liHtml4="<li>" + $(this).attr("ows_PointOfContact")+ "</h4>"+"</li>";
var liHtml5="<li>" + ($(this).attr("ows_Important_x0020_Link")).split(", ")[0]+"</li>";


$("#tasksUL").append(text);
$("#tasksUL").append(liHtml2);
$("#tasksUL").append(liHtml3);
$("#tasksUL").append(liHtml4);
$("#tasksUL").append(liHtml5);

});
}
}
});







0 commentaires:

Enregistrer un commentaire