1

I wrote a script where, while you hover over Promoted Links Tiles, the links from the subsites' promoted links list is shown.

Everything works fine in Firefox but unfortunately, IE is the most used browser in my company. Surprisingly the method that seems to be the problem is one from SP.js

ListObject[item.get_item('Title')] =item.get_item('LinkLocation').get_url();

Error Message(translated from German):

The object doesn't support this property or method 'get_item'

The function is called with

SP.SOD.executeFunc('sp.js', 'SP.ClientContext', getList);  

Did anyone get an idea on how to fix this? Thanks in advance!

EDIT: Following the Code of the complete Function:

    function getList(){           
console.log("test");
      try{
            /* get the context of the current site */
  var ctx;


          if(listInformation.url == 0){
         ctx = new SP.ClientContext.get_current();
          }

          else{
              ctx = new SP.ClientContext(listInformation.url);
          }
  /* get the web object for the context */
  var web = ctx.get_web();  


  /* get the locations list */
  var list = web.get_lists().getByTitle(listInformation.listName);

             /* get the web object for the context */




               var query = new SP.CamlQuery();  

            query.set_viewXml(SP.CamlQuery.createAllItemsQuery());

      /* load the locations, passing in the function delegates to 

     handle when the results are returned or error */
            promlinkslist = list.getItems(query);

    ctx.load(promlinkslist);

           ctx.executeQueryAsync(
    Function.createDelegate(this,  createPromListObject), 

    Function.createDelegate(this, onError));
          listNameUnclear = true;

        console.log("request sent");
      }
        catch (err) {
            alert(err);



        }

}














function createPromListObject() 
{


     var enumerator = promlinkslist.getEnumerator();
  if(listInformation.listName == activeName){

      var ListObject = new Object();
    ListObject["name"] = listInformation.listName;


    while (enumerator.moveNext()) {
        item = enumerator.get_current();

    ListObject[item.get_item('Title')] = item.get_item('LinkLocation').get_url();



    }


       PromotedLinksList.push(ListObject);
  }

    else{
    var enumerator = promlinkslist.getEnumerator();

    while (enumerator.moveNext()) {
        item = enumerator.get_current();
       ElementsOfSubsite.push(item.get_item('Title'));




    }

    }
        console.log("done");
      ongoingRequest = false;



}
  • Please post getlist code – Amal Hashim Aug 3 '16 at 9:53
  • i updated the original post. hope it helps – Bjoern Urban Aug 3 '16 at 14:03

Your Answer

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

Browse other questions tagged or ask your own question.