0

I was following this post where basically all the answers tell you to use generateListFromArray(). When I use this, the function is undefined and I am not able to find any documentation about it.

Here is the code I am using:

    ...
    const dataElement = document.getElementById('data');
    ...
    
    fetch(proxyurl + url)
      .then(response => response.text())  
      .then(html => {
      
      
      const parser = new DOMParser();
      const documentQuery = parser.parseFromString(html, 'text/html');
    
      // Load specifc information to the page instead of the entire document (FYI - We have received the full page anyway so it won't make this any faster).
      const parsedHtml = [...documentQuery.documentElement.querySelectorAll('#list')];
    
      // Outputs all html included on the queried page
      dataElement.innerHTML = generateListFromArray(parsedHtml).innerHTML
      console.log(parsedHtml[0])
    }
    ...
<div id='data' class="container card-body"></div>
Tom Dickson
  • 136
  • 9
  • It's not a built-in function. The author of the other question wrote it. – Felix Kling Mar 13 '19 at 07:07
  • 1
    It's a function from the post the author references - [this post](https://stackoverflow.com/questions/11128700/create-a-ul-and-fill-it-based-on-a-passed-array) (The function here is called `makeUL`, but it's the same function) – Jack Bashford Mar 13 '19 at 07:07

0 Answers0