Code for sample 4
(See how it looks like)
Place the following code into a frame (feel free to change layout and style).
You need to:
-
place a piece of JavaScript into the <head> section of the page
-
add an on-load event into the <body> tag
-
add the code of the translation form
1. JavaScript code
Place the following JavaScript code just before the </head> tag:
|
<head>
...
<script language="JavaScript"
src="http://www.foreignword.com/tools/jv_dictsrch_aff_standard.js"></script>
</head>
|
2. Change body tag
Add the attribute "onload=FWOnLoad(code1,code2)" to the body tag of the HTML page.
The parameters specify the default source and target language combination. "BP" corresponds to English and "AA" to mono-lingual. Click
here for a list of all available language codes.
<body
onload="FWOnLoad('BP','AA')"> |
3. Add the translation form
The actual form is implemented by the HTML code printed below.
|
<!-- ******* Foreignword translation form ********* --> <form name="TSearch" method="get" action="http://www.foreignword.com/Tools/dictsrch_aff.asp" target="bottom">
<!-- remove the following field and the Foreignword menu is not displayed --> <input type="hidden" name="menu" value="Y">
<table border="3" cellPadding="1" cellSpacing="1" align="center"> <tr><td align="right"> <table background bgColor="gold" border="0" cellPadding="3" cellSpacing="0" width="300"> <tr><td>
<!-- text input field --> <input name="query" size="25"></td><td>
<!-- source languages --> <script language="JavaScript">FWSourceLangCombo()</script> </td></tr> <tr><td>
<!-- translate button --> <input name="go" type="submit" value="Translate"> </td><td>
<!-- target languages --> <script language="JavaScript">FWTargetLangCombo()</script>
</td></tr> </table> <font size="1">Powered by <a href="http://www.foreignword.com" target="_top">Foreignword.com</a></font></td></tr></table> </form> <!-- **************** -->
|