Var input;
for (var i = 0; i < count; i++) {
input = prompt("Введите фамилию " + (i + 1) + "-го студента группы");
if (input == "") {
alert("Повторите пожалуйста ввод");
i--;
continue;
} else if (input == null) {
break;
}
document.write((i + 1) + "-й студент: " + input + "<br>");
}
</script>
</html>
Задание 15 <html>
<head>
<title>Задание 15</title>
</head>
<body></body>
<script type="text/javascript">
array = new Array(8);
array = ['Рысев',
'Бабаевскйи',
'Грузинов',
'Туровский',
'Даниляк',
'Титович',
'Телящин',
'Семенков',];
for (var i = 0; i < array.length; i++) {
if (i == 1 || i == 5 || i == 7) {
continue;
}
document.write(array[i] + ",");
}
</script>
</html>
Задание 16 <html>
<head>
<title>Задание 16</title>
</head>
<body>
<img style="border: 2px solid #ccc; float:left;z-index: 5; position: relative;"
src="image/1.png"/>
<img style="border: 2px solid #ccc; float:left; margin-left: -40px; margin-top: 100px; z-index: 4; position: relative;"
src="image/2.png"/>
<img style="border: 2px solid #ccc; float:left; margin-left: -40px; margin-top: 200px; z-index: 3; position: relative;"
src="image/3.png"/>
<img style="border: 2px solid #ccc; float:left; margin-left: -40px; margin-top: 50px; z-index: 2; position: relative;"
src="image/4.jpg"/>
<img style="border: 2px solid #ccc; float:left; margin-left: -80px; margin-top: 200px; z-index: 1; position: relative;"
src="image/5.png"/>
<button onclick="count()">Сосчитать картинки</button>
</body>
<script type="text/javascript">
function count() {
WinReport = window.open(" ", " ", "width=250,heigth=100");
WinReport.document.write("Всего элементов на странице: ",document.all.length,"<br/>");
WinReport.document.write("рисунков: ",document.images.length,"<br/>");
WinReport.document.write("форм: ",document.forms.length,"<br/>");
WinReport.document.write("элементов в первой форме: ",document.forms[0].length,"<br/>");
}
</script>
</html>
Задание 17
<HTML>
<HEAD>
<TITLE>Пример использования объектов ActiveX</TITLE>
<SCRIPT>
function main(){
Var Excel, Book;
Excel=new ActiveXObject('Excel.Application");
Excel.Visible=true;
Book=Excel.Workbooks.Add()
Book.ActiveSheet.Cells( 1,1).Value = "This is column A, row 1";
Book.SaveAs("L:/1.xls");
Excel.Application.Quit();
}
</SCRIPT>
</HEAD>
<BODY>
<FORM>
<input type="button" onclick="main()" value="Получить документ Excel"> </FORM></BODY></HTML>
<HTML>
<HEAD>
<TITLE>Пример использования объектов ActiveX</TITLE>
<SCRIPT>
function main(){
// Start a new instance of Microsoft Word
var MsWord = new ActiveXObject(“Word.Application”);
// Create a new document
MsWord.Documents.Add();
//Carriage Return
MsWord.Selection.TypeParagraph();
//Report Name
MsWord.Selection.TypeText(crmForm.all.new_name.value);
//Carriage Return
MsWord.Selection.TypeParagraph();
//Carriage Return
MsWord.Selection.TypeParagraph();
//Memo field from CRM containing paragraphs of text
MsWord.Selection.TypeText(crmForm.all.new_body.value);
//Show Microsoft Word
MsWord.Visible = true;
msWord.Documents.Add(“http://myserver:5555/documentTemplate.dotx”);
}
</SCRIPT>
</HEAD>
<BODY>
<FORM>
<input type="button" onclick="main()" value="Получить документ Word"> </FORM></BODY></HTML>
Задание 18 <html>
<head>
<title>Задание 18</title>
</head>
<body>
<button onclick="set()">Установить пароль</button>
<button onclick="attempts()">Количество попыток</button>
<button onclick="enter()">Войти в систему</button>
</body>
<script type="text/javascript">
var pwd = "test";
var att = 3;