powered by simpleCommunicator - 2.0.61     © 2026 Programmizd 02
Целевая тема:
Создать новую тему:
Автор:
Закрыть
Цитировать
Форумы / HTML, JavaScript, VBScript, CSS [игнор отключен] [закрыт для гостей] / Как использовать window.open
2 сообщений из 2, страница 1 из 1
Как использовать window.open
    #38742094
Dimmf28
Скрыть профиль Поместить в игнор-лист Сообщения автора в теме
Участник
Добрый вечер столкнулся с такой вот проблемой я хочу чтоб вместо ссылки выполнялась моя функция которая в свою очередь
использует window.open и открывает в нем окно

вот код как я пробывал , подскажите как надо

Код: javascript
1.
2.
3.
4.
5.
6.
7.
8.
9.
10.
11.
12.
13.
14.
15.
16.
17.
18.
19.
20.
21.
22.
23.
24.
25.
<!DOCTYPE html>
<html>
<body>

<p>Click the button to write some text in the new window and the source (parent) window.</p>

<button onclick="myFunction('lol37.php?','<? echo 'lol=4';?>');">Try it</button>

<script>
function myFunction(q,p) {
    var myWindow = window.open(q+p, "myWindow", "width=600,top=150,left=400, height=300,scrollbars=yes,status=yes,resizable=yes");
   // myWindow.document.write("<p>This is 'myWindow'</p>");
   // myWindow.opener.document.write("<p>This is the source window!</p>");
}
</script>

<hr/>


<a href="#" onclick="myFunction('lol37.php?','<? echo 'lol=4';?>');">
  открыть комментарий
</a>

</body>
</html>
...
Рейтинг: 0 / 0
Как использовать window.open
    #38742412
Фотография krvsa
Скрыть профиль Поместить в игнор-лист Сообщения автора в теме
Участник
Dimmf28подскажите как надо
Как вариант...

Код: html
1.
2.
3.
4.
5.
6.
7.
8.
9.
10.
11.
12.
13.
14.
15.
16.
17.
18.
19.
20.
21.
22.
23.
24.
25.
26.
<!DOCTYPE html>
<html>
<head>
<!--
<script src='http://code.jquery.com/jquery-latest.js'></script>
<link rel='stylesheet type=text/css href=tmp.css' />
-->
<style type='text/css'>
</style>
<script type='text/javascript'>
function myFunction(q,p) {
	var myWindow = window.open('test', "myWindow", "width=600,top=150,left=400, height=300,scrollbars=yes,status=yes,resizable=yes");
	myWindow.document.write("<p>This is 'myWindow'</p>");
	myWindow.opener.document.write("<p>This is the source window!</p>");
}
</script>
</head>
<body>
<p>Click the button to write some text in the new window and the source (parent) window.</p>
<button onclick="myFunction('lol37.php?','1');">Try it</button>
<hr/>
<a href="javascript: myFunction('lol37.php?','2');">
	открыть комментарий
</a>
</body>
</html>



P.S.
И не суйте вы сюда свое ПХП... Тут оно нафик не нужно.
...
Рейтинг: 0 / 0
2 сообщений из 2, страница 1 из 1
Форумы / HTML, JavaScript, VBScript, CSS [игнор отключен] [закрыт для гостей] / Как использовать window.open
Найденые пользователи ...
Разблокировать пользователей ...
Читали форум (0):
Пользователи онлайн (0):
x
x
Закрыть


Просмотр
0 / 0
Close
Debug Console [Select Text]