0

I have a list inside it I have a hyperlink column with items like www.google.com and www.youtube.com. I can retreive the list items and show on my site the problem is I get only the url and its not clickable. Anyone have clue how to fix it? I tried with ahref tags like this. I want every hyperlink item to be clickable.

while (enumerator.moveNext()) {
            var listItem = enumerator.get_current();

            itemString += listItem.get_item('Title') + "<br/>" + "<a href" + listItem.get_item('Link').get_url() + "</a>";

            $('#divAllaListItems').html(itemString);
        }
1

That is an incorrect anchor tag. You'd want it to be something like this:

itemString += "<a href='" + listItem.get_item('Link').get_url() + "'>"+listItem.get_item('Title') +"</a>";
  • Okey thank you, I tested it now I dont get any errors but I get this message: "Property or the field has not been initialized. There has been no request or has not been performed. It may need to be requested specifically." In my list I added some links under hyperlink column. – Sunreuz Sep 29 '15 at 17:36

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.