Widget:Laad meer berichten
Uit Dorpsbelang Den Hout
<script>var offset=0; function loadMoreBerichten(set){
var wikitext = `... meer resultaten`;
offset += set;
var params = {
action: 'parse',
text: wikitext,
contentmodel: 'wikitext',
format: 'json'
},
api = new mw.Api();
api.post( params ).done( function ( data ) {
console.log(data.parse.text['*'])
var newrow = document.createElement('div');
newrow.classList.add('row')
document.querySelector('.fa-plus').closest('.row').insertBefore(newrow, document.querySelector('.fa-plus').closest('.col-md-6'))
newrow.innerHTML = data.parse.text['*'];
})
} </script>