JQuery not working in WordPress

Exception

The jQuery is not working in WordPress and you are getting the error as shown in Figure 2.1

Figure 2.1 Figure 2.1

Solution

Use jQuery instead of $ as shown in following code

jQuery(document).ready(function() {
	var testdata=["Java","J2ee","Spring","Hibernate","CSS","HTML","Struts","Struts 2","Maven","Maven 2","Spring Roo","JSF","JSF 2.0","EJB"];
	var maxlimit = jQuery( "#maxlimit" );
	jQuery("#testlanguage").keyup(function() {
	if(maxlimit.val().length==0) {
		maxlimit.val('5');
		
	}
	jQuery('input[name=testlanguage]').autocomplete({
		minLength: 1,source: function(request, response) {
	        var results = jQuery.ui.autocomplete.filter(testdata, request.term);
	        response(results.slice(0, maxlimit.val()));
	    }
	});
	});
});


,

No comments yet.

Leave a Reply