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?