Touchstart event for wikiview project

Touchstart event for wikiview project
0

#1

Hello, i’m trying to get the touchstart event to work on mobile for my wikiview project? Does anyone have experience with this?

$outputButton.on('click touchstart', function (e) {
  //request to MediaWiki
  let url = wikiLink + searchTerm.value;
  //fetch data from MediaWiki
  fetch(url)
    .then(resp => resp.json())
    .then(function (data) {
      let html='';
      let activeLink = 'https://en.wikipedia.org/wiki/';
      //map over items and build out content
      data.query.search.map(function (item) {
        html += `<section class='output-card'>
                  <a href='${activeLink}${item.title}' target='_blank'>
                    <h4>${item.title}</h4>
                    <p>${capitalizeFirstLetter(item.snippet)}.</p>
                  </a>
                  </section>`;
        output.innerHTML = html;
      });
    });
  });

Is what i’ve tried so far? Any suggestions?


#2

Update:

I can’t seem to get any events to fire on mobile, but everything works just fine on desktop? I have to be missing something simple. I tried to change the cursor to pointer on the body as mentioned in a SO post.

Here is the link to my project:

If anyone has any suggestions or has experienced this before, id appreciate the help. Thanks!