In a situation where the same page could be loaded into the DOM multiple times, but with different html being loaded each time by ajax, how do I make it so the data is only changed on the current instance of the page, rather than all of them? i.e. only selecting the element on the current instance of the page.
$$(document).on('page:init', function (e) {
var page = e.detail;
if (page.name === 'sopload') {
var sop = mainView.router.currentRoute.params.sop;
var sopfile = 'sops/' + sop + '.html';
$$('.sop-title').html(sop);
app.request.get(sopfile, function (data) {
$$('.sop-block').html(data);
});
}
});