1

I've made several edits to this line, but they do not appear to be working.

html = html + "< a href='" + this.LinkingUrl + target="_blank"+"'>" + this.Name

$.ajax({
url: "https://gumdropsgc.sharepoint.com/sites/Training/_api/web/GetFolderByServerRelativeUrl('Production_Library/communication management')/files?$select=LinkingURL,Name&$orderby=LinkingURL",
type: "GET",
headers: {"Accept": "application/json;odata=verbose"},
cache:false,                
success: function(data){
        console.log(data);
        var html = "";
        $(data.d.results).each(function(){
            html = html + "" + this.Name + "
" ; }); html += ""; $("#listResult2").html(html) } });

2 Answers 2

2

This should be it:

html = html + "< a href='" + this.LinkingUrl + "' target='_blank' >" + this.Name + "</a>"
1

Using the ES6 template literals seems very handful for situations like this.

html += `<a href='${this.LinkingUrl}' target='_blank'>${this.Name}</a>`

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.