Пример Установка:
между
и
Code
<SCRIPT LANGUAGE="JavaScript">
<!-- This script and many more are available free online at -->
<!-- The JavaScript Source!! http://gamecreate.my1.ru/ -->
<!-- Begin
function generate(form) {
var txt = '<' + '!-- ДВА ШАГА ДЛЯ УСТАНОВКИ КОДА: --' + '>\r\n\r\n'
+ ' <' + '!-- 1. Поместить код в HEAD вашего HTML документа --' + '>\r\n';
txt = txt + ' <' + '!-- 2. Поместить код в BODY вашего HTML документа --' + '>\r\n\r\n'
+ '<' + '!-- ШАГ ПЕРВЫЙ: Поместите эту часть кода в HEAD вашего HTML документа --' + '>\r\n\r\n'
+ '\r\n\r\n'
+ '<SCR' + 'IPT LANG' + 'UAGE="JavaS' + 'cript">\r\n'
+ '<!-- Original: Ronnie T. Moore, Managing Editor -->\r\n'
+ '<!-- Web Site: http://javascript.internet.com -->\r\n\r\n'
+ '<!' + '-- Begin\r\n'
+ 'func' + 'tion show' + 'FAQ(form) ' + '{\r\n'
+ 'form.' + 'answer.value = form.' + 'question.options[form.question.'
+ 'selectedIndex].value;\r\n' + '}' + '\r\n/' + '/ End --' + '>\r\n'
+ '</SCR' + 'IPT>\r\n\r\n\r\n'
+ '<!-- ШАГ ВТОРОЙ: Поместите эту часть кода в BODY вашего HTML документа -->\r\n\r\n'
+ '\r\n\r\n<center>\r\n<fo' + 'rm name=faqform>\r\n'
+ '<table border=1 cellspacing=0 cellpadding=5>\r\n';
if (document.faqgen.faqtitle.value != "") {
txt = txt + '<tr bgcolor="#000099">\t\n<td align=center><font face="verdana,arial" size="-1" '
+ 'color="#ffffff">\r\n<b>' + document.faqgen.faqtitle.value + '</b></font></td>\r\n</tr>\r\n';
}
txt = txt + '<tr bgcolor="#ffffcc"><td><font face="verdana,arial" size="-1"><br>\r\nОзнакомьтесь с часто '
+ 'задаваемыми вопросами и кликните по любому для получения ответа.\r\n
\r\n<ul>'
+ '<select size=10 name=question onChange="java' + 'script:showFAQ(this.form);">\r\n';
for (var i = 1; i <= 10; i++) {
q = eval('document.faqgen.q' + i + '.value');
a = eval('document.faqgen.a' + i + '.value');
if (q!="" && a!="") {
txt = txt + '<option value="' + a + '"> --> ' + q + '\r\n';
}
else {
break;
}
}
txt = txt + '</select>\r\n'
+ '</ul>\r\n'
+ '
\r\n'
+ 'Ответ на вопрос:\r\n'
+ '
\r\n'
+ '<ul>\r\n'
+ '<textarea name="answer" rows=15 cols=50 wrap=virtual></textarea>\r\n'
+ '</ul>\r\n'
+ '</font>\r\n'
+ '</td>\r\n'
+ '</tr>\r\n'
+ '</table>\r\n'
+ '</form>\r\n'
+ '</center>';
document.mail.source.value=txt;
}
function View(text) {
msg=window.open("","DisplayWindow");
msg.document.write(text);
msg.document.write("</body></html>");
}
// End -->
</SCRIPT>
между
и
Code
<center>
<form name=faqgen>
<table border=2 bgcolor="#808080" width="370">
<tr>
<td colspan=2 width="358"><h2 align="center">
<font color="#FFFFFF" size="6"><b>
FAQ мэйкер</b></font></h2></td>
</tr>
<tr>
<td colspan=2 align=center width="358">
<font color="#FFFFFF">
<font size="2">
Название FAQ: <input type=text name=faqtitle size=25 value="" style="background-color: #DEDFDF; border-style: solid; border-width: 0">
</font></font>
</td>
</tr>
<tr align=center>
<td colspan=2 align=center width="358">
<b>
<font size="3" color="#FFFFFF">
Наиболее частые вопросы и ответы к ним:
</font>
</b></td>
</tr>
<tr align=center>
<td width="177" valign=middle>
<strong>
<font size="3" color="#FFFFFF">
Вопрос 1
</font>
</strong>
<font size="3" color="#FFFFFF">
<br>
<textarea name=q1 rows=3 cols=17 style="background-color: #DEDFDF; border-style: solid; border-width: 0"></textarea>
</font>
</td>
<td width="177" valign=middle>
<strong>
<font size="3" color="#FFFFFF">
Ответ 1
</font>
</strong>
<font size="3" color="#FFFFFF">
<br>
<textarea name=a1 rows=3 cols=17 style="background-color: #DEDFDF; border-style: solid; border-width: 0"></textarea>
</font>
</td>
</tr>
<tr align=center>
<td width="177" valign=middle>
<strong>
<font size="3" color="#FFFFFF">
<font size="3">
Вопрос
</font>
</font>
</strong>
<font size="3" color="#FFFFFF">
<strong> 2</strong><br>
<textarea name=q2 rows=3 cols=17 style="background-color: #DEDFDF; border-style: solid; border-width: 0"></textarea>
</font>
</td>
<td width="177" valign=middle>
<strong><font size="3" color="#FFFFFF">Ответ </font></strong><font size="3" color="#FFFFFF"><strong>
2</strong><br>
<textarea name=a2 rows=3 cols=17 style="background-color: #DEDFDF; border-style: solid; border-width: 0"></textarea></font></td>
</tr>
<tr align=center>
<td width="177" valign=middle>
<strong>
<font size="3" color="#FFFFFF">
<font size="3">
Вопрос
</font>
</font>
</strong>
<font size="3" color="#FFFFFF">
<strong> 3</strong><br>
<textarea name=q3 rows=3 cols=17 style="background-color: #DEDFDF; border-style: solid; border-width: 0"></textarea>
</font>
</td>
<td width="177" valign=middle>
<strong><font size="3" color="#FFFFFF">Ответ </font></strong><font size="3" color="#FFFFFF"><strong>
3</strong><br>
<textarea name=a3 rows=3 cols=17 style="background-color: #DEDFDF; border-style: solid; border-width: 0"></textarea></font></td>
</tr>
<tr align=center>
<td width="177" valign=middle>
<strong>
<font size="3" color="#FFFFFF">
<font size="3">
Вопрос
</font>
</font>
</strong>
<font size="3" color="#FFFFFF">
<strong> 4</strong><br>
<textarea name=q4 rows=3 cols=17 style="background-color: #DEDFDF; border-style: solid; border-width: 0"></textarea>
</font>
</td>
<td width="177" valign=middle>
<strong><font size="3" color="#FFFFFF">Ответ </font></strong><font size="3" color="#FFFFFF"><strong>
4</strong><br>
<textarea name=a4 rows=3 cols=17 style="background-color: #DEDFDF; border-style: solid; border-width: 0"></textarea></font></td>
</tr>
<tr align=center>
<td width="177" valign=middle>
<strong>
<font size="3" color="#FFFFFF">
<font size="3">
Вопрос
</font>
</font>
</strong>
<font size="3" color="#FFFFFF">
<strong> 5</strong><br>
<textarea name=q5 rows=3 cols=17 style="background-color: #DEDFDF; border-style: solid; border-width: 0"></textarea>
</font>
</td>
<td width="177" valign=middle>
<strong><font size="3" color="#FFFFFF">Ответ </font></strong><font size="3" color="#FFFFFF"><strong>
5</strong><br>
<textarea name=a5 rows=3 cols=17 style="background-color: #DEDFDF; border-style: solid; border-width: 0"></textarea></font></td>
</tr>
<tr align=center>
<td width="177" valign=middle>
<strong>
<font size="3" color="#FFFFFF">
<font size="3">
Вопрос
</font>
</font>
</strong>
<font size="3" color="#FFFFFF">
<strong> 6</strong><br>
<textarea name=q6 rows=3 cols=17 style="background-color: #DEDFDF; border-style: solid; border-width: 0"></textarea>
</font>
</td>
<td width="177" valign=middle>
<strong><font size="3" color="#FFFFFF">Ответ </font></strong><font size="3" color="#FFFFFF"><strong>
6</strong><br>
<textarea name=a6 rows=3 cols=17 style="background-color: #DEDFDF; border-style: solid; border-width: 0"></textarea></font></td>
</tr>
<tr align=center>
<td width="177" valign=middle>
<strong>
<font size="3" color="#FFFFFF">
<font size="3">
Вопрос
</font>
</font>
</strong>
<font size="3" color="#FFFFFF">
<strong> 7</strong><br>
<textarea name=q7 rows=3 cols=17 style="background-color: #DEDFDF; border-style: solid; border-width: 0"></textarea>
</font>
</td>
<td width="177" valign=middle>
<strong><font size="3" color="#FFFFFF">Ответ </font></strong><font size="3" color="#FFFFFF"><strong>
7</strong><br>
<textarea name=a7 rows=3 cols=17 style="background-color: #DEDFDF; border-style: solid; border-width: 0"></textarea></font></td>
</tr>
<tr align=center>
<td width="177" valign=middle>
<strong>
<font size="3" color="#FFFFFF">
<font size="3">
Вопрос
</font>
</font>
</strong>
<font size="3" color="#FFFFFF">
<strong> 8</strong><br>
<textarea name=q8 rows=3 cols=17 style="background-color: #DEDFDF; border-style: solid; border-width: 0"></textarea>
</font>
</td>
<td width="177" valign=middle>
<strong><font size="3" color="#FFFFFF">Ответ </font></strong><font size="3" color="#FFFFFF"><strong>
8</strong><br>
<textarea name=a8 rows=3 cols=17 style="background-color: #DEDFDF; border-style: solid; border-width: 0"></textarea></font></td>
</tr>
<tr align=center>
<td width="177" valign=middle>
<strong>
<font size="3" color="#FFFFFF">
<font size="3">
Вопрос
</font>
</font>
</strong>
<font size="3" color="#FFFFFF">
<strong> 9</strong><br>
<textarea name=q9 rows=3 cols=17 style="background-color: #DEDFDF; border-style: solid; border-width: 0"></textarea>
</font>
</td>
<td width="177" valign=middle>
<strong><font size="3" color="#FFFFFF">Ответ </font></strong><font size="3" color="#FFFFFF"><strong>
9</strong><br>
<textarea name=a9 rows=3 cols=17 style="background-color: #DEDFDF; border-style: solid; border-width: 0"></textarea></font></td>
</tr>
<tr align=center>
<td width="177" valign=middle>
<strong>
<font size="3" color="#FFFFFF">
<font size="3">
Вопрос
</font>
</font>
</strong>
<font size="3" color="#FFFFFF">
<strong> 10</strong><br>
<textarea name=q10 rows=3 cols=17 style="background-color: #DEDFDF; border-style: solid; border-width: 0"></textarea>
</font>
</td>
<td width="177" valign=middle>
<strong><font size="3" color="#FFFFFF">Ответ </font></strong><font size="3" color="#FFFFFF"><strong>
10</strong><br>
<textarea name=a10 rows=3 cols=17 style="background-color: #DEDFDF; border-style: solid; border-width: 0"></textarea></font></td>
</tr>
<tr>
<td colspan=2 align=center height=33 width="358">
<font size="3" color="#FFFFFF">
<input type=button value="Сгенерировать код!" onClick="generate(this.form)">
<input type=reset value="Сброс">
</font>
</td>
</tr>
</table>
<font size="3" color="#000000">
<br><br>
</font>
<font size="3">
<b>Код для Вашей страницы с FAQ</b>
</font>
</form>
</center>
<font size="3" color="#000000">
<center>
<form name="mail">
<table bgcolor="dedfdf" border="2" cellpadding="4" width=371>
<tr><td align=center width="383">
<input type="button" class="button" value="Показать FAQ!" name="DOC" onClick="View(this.form.source.value);">
<div align=left>
<input type=button value="Выделить все" onClick="javascript:this.form.source.focus(); this.form.source.select();">
</div>
<textarea name="source" rows=12 cols=40 style="background-color: #14BAD8"></textarea><br>
<input type="hidden" name="source2"></td></tr>
</table>
</form>
</center>