Vani suggest.js: Difference between revisions
No edit summary |
No edit summary |
||
Line 18: | Line 18: | ||
$('document').ready(function () { | $('document').ready(function () { | ||
$("#google_search").autocomplete("/php_scripts/dictionary.php", { | $("#google_search").autocomplete("http://vanisource.org/php_scripts/dictionary.php", { | ||
scroll: true, | scroll: true, | ||
autofill: false, | autofill: false, | ||
Line 26: | Line 26: | ||
multiple: true, | multiple: true, | ||
multipleSeparator: ' ', | multipleSeparator: ' ', | ||
}); | }); | ||
}); | }); |
Revision as of 15:09, 24 April 2008
// This Jquery code is used to give suggestions in the search box for words with diacritics. // It uses jquery.autocomplete and all its dependencies to fetch suggestions from a php script in the server // and show it in a suggest box as the visitor types. document.write('<script type="text/javascript" src="' + 'http://vanipedia.org/w/index.php?title=MediaWiki:Jquery.bgiframe.min.js' + '&action=raw&ctype=text/javascript"></' + 'script>'); document.write('<script type="text/javascript" src="' + 'http://vanipedia.org/w/index.php?title=MediaWiki:Jquery.dimensions.js' + '&action=raw&ctype=text/javascript"></' + 'script>'); document.write('<script type="text/javascript" src="' + 'http://vanipedia.org/w/index.php?title=MediaWiki:Jquery.autocomplete.js' + '&action=raw&ctype=text/javascript"></' + 'script>'); document.write('<script type="text/javascript" src="' + 'http://vanipedia.org/w/index.php?title=MediaWiki:Jquery.ajaxQueue.js' + '&action=raw&ctype=text/javascript"></' + 'script>'); $('document').ready(function () { $("#google_search").autocomplete("http://vanisource.org/php_scripts/dictionary.php", { scroll: true, autofill: false, selectFirst: false, maxItemsToShow: 10, minChars: 2, multiple: true, multipleSeparator: ' ', }); });