Support » Plugins and Hacks » Hacks » jQuery Autocomplete Not Working in Chrome/Firefox

jQuery Autocomplete Not Working in Chrome/Firefox

  • Hello,

    I’ve made use of the code at https://github.com/stephenh1988/WordPress-AutoComplete-Search to add autocomplete to my WordPress search.

    (It’s based on the tutorial at: http://wp.tutsplus.com/tutorials/theme-development/add-jquery-autocomplete-to-your-sites-search/)

    It works in Safari and does nothing in Chrome and Firefox.

    Unfortunately, I have limited knowledge of javascript. I’m assuming that the problem lies in the following code since, clearly, the backend is doing its job and I’m getting results in Safari.

    <script type="text/javascript">
    	jQuery(document).ready(function ($){
    		var ajaxurl = '<?php echo admin_url( 'admin-ajax.php' ); ?>';
            	var ajaxaction = '<?php echo self::$action ?>';
            	$("#secondary #searchform #s").autocomplete({
    			delay: 0,
    			minLength: 3,
    			source: function(req, response){
    				$.getJSON(ajaxurl+'?callback=?&action='+ajaxaction, req, response);
                		select: function(event, ui) {

    Anyone have an idea of what the problem is?

  • The topic ‘jQuery Autocomplete Not Working in Chrome/Firefox’ is closed to new replies.