views:

206

answers:

2

I've been using the JQuery Autocomplete plugin with JQuery version 1.3.2, and it has been working great. I recently updated JQuery in my project to version 1.4.2, and the Autocomplete plugin is now broken. The JQuery code to add items to a textbox on my web page doesn't seem to be getting called at all. Does anyone know if the JQuery Autocomplete plugin is incompatible with JQuery version 1.4.2, and if there is a fix for this problem? Here is some sample code I've built in an ASP.Net web site (which works fine if I change the JQuery file to jquery-1.3.2.js, but nothing happens using jquery-1.4.2.js):

<%@ Page Language="C#" AutoEventWireup="true"  CodeFile="Default.aspx.cs"    Inherits="_Default" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"&gt;

<html xmlns="http://www.w3.org/1999/xhtml"&gt;
<head runat="server">
<title>Untitled Page</title>
    <script type="text/javascript" src="js/jquery-1.4.2.js" ></script>
<script type="text/javascript" src="js/jquery.autocomplete.js" ></script>
<script type="text/javascript">
    $(document).ready(function() {
        var data = "Core Selectors Attributes Traversing Manipulation CSS Events    Effects Ajax Utilities".split(" ");
        $(':input:text:id$=sapleUser').autocomplete(data);
    }); 
</script>  
</head>
<body>
<form id="form1" runat="server">
    API Reference: <input id="sapleUser" autocomplete="off" type="text" runat="server" /> (try "C" or "E")  
</form>
</body>
</html>
A: 

It turned out that the Autocomplete plugin is compatible with JQuery ver 1.4.1 and 1.4.2. The problem was caused by my JQuery selector: $(':input:text:id$=sapleUser'), which appears not to be compatible with the 1.4.x versions of JQuery. I modified the selector to: $('input[id$=sapleUser]'), and it is now working again.

Russ Clark
A: 

I have an error message saying this: Detaljer om feil på webside

Message: Object does not support property or method Line: 18 Character: 2 <----(that's the second $) Kode: 0 URI: http://192.168.1.108/auto.asp

My code looks like this:

$(document).ready(function(){ $("#singleBirdRemote").autocomplete("ost.asp", { width: 260, selectFirst: false }); });

I'm no good in Java, so I just copy/paste the code, and change the datasource to "ost.asp" wich is a copy of the result from the original.

Hope someone can help :)

Jan