window.opener error on trigger event
-
19-06-2021 - |
Question
I'm running this code to try to make a page reload after I closed the current one (that edits values from the one thats supposed to reload):
setTimeout( function() {
window.opener.$('window').('reload');
window.close();trigger
}, 1700);
And I get this error every time:
XML filter is applied to non-XML value ({length:0, prevObject:{0:({}), context:({}), length:1}, context:({}), selector:"window"})
I really don't understand anything about XML and I don't even understand whats wrong...
Solution
Your syntax is incorrect. You're trying to reference a property of window.opener
which is equivalent to the jQuery object. Remove the references to the jQuery methods, as that just provides an alternative technique for selecting the current window, and is irrelevant here.
setTimeout( function() {
window.opener.location.reload();
window.close();
}, 1700);
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow