I have a page ( parent window ) that opens a popup window ( child ) with JavaScript , and when I press a button from the child window, it closes, and I need one div
of the parent window to be updated.
I have tried with parent.location.reload
but it reloads the whole page and I don't want that, I want to update only a certain element of the screen.
I have also tried document.getElementById.reload
but it doesn't work either. Is there a way to do this with JavaScript ?
The value to be updated is updated in Java using a action
button that has it. All I need is for that part of the page to be updated to display that value.
HTML elements don't have a location attribute and they don't support reloading using
location.reload
them so now you should be getting the errorWhat you could try is to trigger the click event on the button of the parent window:
This assuming that the click on the button just causes the div that contains it to be refreshed.
Otherwise, you first have to give the main page some way to partially reload its content (via ajax for example) in order to trigger that same action from a child window.