Консультация № 60791
31.10.2006, 17:48
0.00 руб.
0 2 2
Уважаемые Эксперты!

Вопрос: как с помощью JS обновить страницу, находящуюся в другом окне? Т.е. не ту страницу, на которой находится скрипт.

Обсуждение

Неизвестный
31.10.2006, 18:09
общий
это ответ
Здравствуйте, chiefff!
Если это дочернее окно, то вот так (только вместо alert Вам надо сделать location.reload([true]):
(пример с сайта нетскейпа)
The following statements refer to a form named musicForm in a window named checkboxWin. The statements determine if a checkbox is checked, check the checkbox, determine if the second option of a Select object is selected, and select the second option of the Select object. Even though object values are changed in checkboxWin, the current window remains active: checking the checkbox and selecting the selection option do not give focus to the window.

// Determine if a checkbox is checkedif (checkboxWin.document.musicForm.checkbox2.checked) { alert(‘The checkbox on the musicForm in checkboxWin is checked!‘)}// Check the checkboxcheckboxWin.document.musicForm.checkbox2.checked=true// Determine if an option in a Select object is selectedif (checkboxWin.document.musicForm.musicTypes.options[1].selected) {alert(‘Option 1 is selected!‘)}// Select an option in a Select objectcheckboxWin.document.musicForm.musicTypes.selectedIndex=1

Неизвестный
01.11.2006, 09:37
общий
это ответ
Доброе время суток, chiefff

если необходимо обновить страницу _из_ открытой,
то используйте код из-под объекта opener

window.opener.*

т.е. в только что созданном окне с помощью open(); используем код с _opener_, чтобы получить ссылку на все объекты _parent_(по отношению к открытому) окна

с уважением, удачи
Форма ответа