I'm attempting to retrieve the DOM of a specific page.
var req = new XMLHttpRequest();
req.open( 'GET', '/sport-hobby-kultura?adListing-visualPaginator-page=2&adListing-url=sport-hobby-kultura&do=adListing-visualPaginator-showPage', true );
// set responseType document to return DOM
req.responseType = 'document' || '';
// set X-Requested-With header to check that is ajax request
req.setRequestHeader('X-Requested-With', 'XMLHttpRequest');
req.send();
However, I am encountering an issue where it returns NULL. It seems to be related to the parameters in the URL of the request. Surprisingly, when I remove them, the request functions flawlessly (example below):
var req = new XMLHttpRequest();
req.open( 'GET', '/sport-hobby-kultura', true );
// set responseType document to return DOM
req.responseType = 'document' || '';
// set X-Requested-With header to check that is ajax request
req.setRequestHeader('X-Requested-With', 'XMLHttpRequest');
req.send();
Any insights on why it only works without the GET parameters? The page behaves correctly when accessed via browser or API tester.