Sangwal’s Weblog

Just another WordPress.com weblog

Scripts on WordPress

leave a comment »

Today I tried to put my javascript code into a post on WordPress. To my dismay, it simply did not work on it. Moreover, to my surprise it is found that WordPress strips all the <script> tags and leaves almost nothing behind. Whatever was left was of no avail. Anyway, if you need to translate Polish words into English, you can search the ‘Pol-Ang Słownik’ (Polish to English dictionary, http://slownik.freehostia.com) or alternatively you may place the search box on your web pages (and even allow visitors to your pages to search Polish words). To put the search box into your pages, simply copy and paste the following code into your page:

<!– begin code: Pol-Ang dictionary(http://slownik.freehostia.com) search box –>
<script type=”text/javascript” src=”http://slownik.freehostia.com/ajax-searchbox.js”>
</script>
<script type=”text/javascript”>
var color_entry = ‘green’;
var color_def = ‘black’;
var color_owner = ‘gray’;
var color_ex = ‘gray’;
var size_owner = ‘80%’;
var size_ex = ‘80%’;
</script>
<title></title>
</head>
<body>
<div style=
“width:200pt;border:solid;border-width:1;border-color:blue;”>
<div id=”ajax_error”></div>
<div style=
“background:lightblue;border-bottom:solid;border-width:1;text-align:center”>
<h1 style=’display:inline;font-size:90%;font-family:sans-serif;’>
Pol-Ang Slownik (Polish-English)
</h1>
<form name=”jax_search_form” id=”jax_search_form”>
<input type=”text” name=”ajax_search_word” onkeypress=
“return checkEnter(event);”> <input type=”button” name=
“search_button” value=”Search” onclick=
“ajaxFunction()”><br>
<h1 style=
‘display:inline; font-weight:normal;font-size:70%’>
<a href=”http://slownik.freehostia.com” mce_href=”http://slownik.freehostia.com” >
</h1>
</form>
</div>
<div id=”ajax_contents”></div>
</div>
<!– end of code: Pol-Ang dictionary
(http://slownik.freehostia.com) search box –>

Free free to experiment with the code to change the layout of the text box. Cheers!

PS: I see quotes (” and ‘) have been altered by WordPress, or atleast it displays them all altered, but internally keeps the original. If it the case, change them to normal quotes.

To see how the search box looks like, please see here.

Written by sangwal

March 1, 2008 at 12:16 am

Leave a Reply