I am trying to trigger a mouseover event on an element on this page: idealista.
If you open DevTools and put your mouse over one of the elements, it will send a /px/xhr/api/v2/collector request if your mouse was not in the viewport before. Payload of this request contains Base64 encoded information about the event:
[
{
"t": "PX297",
"d": {
"PX38": "mouseover",
"PX70": 1631,
"PX157": "true",
"PX72": "#home-image",
"PX34": "TypeError: Cannot read property '0' of null\n at kt (https://www.idealista.com/px/client/main.min.js:2:13662)\n at HTMLBodyElement.Wn (https://www.idealista.com/px/client/main.min.js:2:20855)",
"PX78": 957,
"PX79": 321,
"PX850": 2,
"PX851": 2392,
"PX371": true,
"PX96": "https://www.idealista.com/"
}
}
]
I can trigger click event (by $('#home-image').click()). But when I am trying to do that with mouseover or mouseenter, no result:
$('#home-image').click() // Sending request is triggered
$('#home-image').mouseover() // Sending request is NOT triggered
$('#home-image').mouseenter() // Sending request is NOT triggered
UPD:
None of these trigger the request:
for (let e of ['enter', 'over', 'move', 'leave', 'out']) {
$('#home-image').trigger('mouse' + e);
}
.dispatchEventworked! Thanks!