Javascript-форум (https://javascript.ru/forum/)
-   Элементы интерфейса (https://javascript.ru/forum/dom-window/)
-   -   Генерация скрипта (https://javascript.ru/forum/dom-window/27855-generaciya-skripta.html)

Sergic_l 27.04.2012 10:10

Генерация скрипта
 
Можно ли генерировать JS в новом окне? Если можно, то какой синтаксис?

Octane 27.04.2012 10:32

Добавьте <script> или выполните eval

Sergic_l 28.04.2012 15:22

Беда собственно в том, что оператор в стр.17 закрывает скрипт в стр. 0

0.<script type="txt/javascript">
1.function ow()
2.{
3.var OpenWindow=window.open("", "vl1", "height=500px,width=1000px,scrollbars=1,resizable= 1");

4.OpenWindow.document.write("<HTML>");
5.OpenWindow.document.write("<HEAD>");
6.OpenWindow.document.write("<TITLE>Новое окно</TITLE>");
7.OpenWindow.document.write("<link href='img.css' rel='stylesheet' type='text/css'>");
8.OpenWindow.document.write("</HEAD>");
9.OpenWindow.document.write("<BODY BGCOLOR='white'>");
10.OpenWindow.document.write("<center>");
11.OpenWindow.document.write(" <img width='744' height='620' src='pic/Vladimir/01.bmp'>")
12.OpenWindow.document.write("</center>");
13.OpenWindow.document.write("</BODY>");
14.OpenWindow.document.write("</HTML>");
15.OpenWindow.document.write("<script type='text/javascript'>" );
16.OpenWindow.document.write("alert('mom')")
17.OpenWindow.document.write("</script>");
18.}
19.</script>

Octane 28.04.2012 15:45

write("</sc" + "ript>")

Sergic_l 29.04.2012 10:13

Получилось! Спасибо.


Часовой пояс GMT +3, время: 07:17.