Skip navigation
pjunkie
Currently Being Moderated

Jquery autocomplete with json

Nov 14, 2013 9:43 AM

Does anyone have a full working example of Jquery autocomplete with json that works?

 

I can't get any of the examples that I am finding online to work.

 
Replies
  • Currently Being Moderated
    Nov 15, 2013 8:01 AM   in reply to pjunkie

    Please define "doesn't work". Put your code online somewhere so that we can see it running.

     
    |
    Mark as:
  • Currently Being Moderated
    Nov 17, 2013 2:06 AM   in reply to pjunkie

    AS you know, the CFC just replaces the file by outputting exactly the same data as the file would. Without seeing HTTP traces, JavaScript error logs etc etc it's very hard to give an answer or see what is wrong. Please put your code online so I can take a look at it actually running.

     

    Btw, my answer here http://forums.adobe.com/thread/1319717?tstart=0 refers to a script that uses Ajax already, and the data is JSON encoded too.

     
    |
    Mark as:
  • Currently Being Moderated
    Nov 18, 2013 4:16 AM   in reply to pjunkie

    jQuery is nothing to do with ColdFusion. You are just using ColdFusion to serve out data from a database query. You will have to find a way to get your code online so we can see it, since there are many dozens of reasons as to why code does not work the way it should.

     
    |
    Mark as:
  • Currently Being Moderated
    Nov 18, 2013 11:51 PM   in reply to pjunkie

    The ongoing thread here http://www.houseoffusion.com/groups/cf-talk/thread.cfm/threadid:64866 is really saying the same thing you and I are, namely that the data is not in the correct format (as you know). That thread made mention to this article: http://www.petefreitag.com/item/720.cfm. The leading "//" on the front of that data shows that secure JSON is enabled. This "//" prefix needs to be removed from the data. Can you put this in your code to turn secure JSON off and then see what response you get?

     

    <cfset this.secureJSON = false>

     
    |
    Mark as:
  • Currently Being Moderated
    Nov 19, 2013 6:19 AM   in reply to pjunkie

    Well done, the format plain must be a simple JavaScript array then? I think if you had secureJSON off and the plain return format, it would have worked too. Btw JSON comment prefixes can be disabled via the CF admin too. All's well that ends well.

     
    |
    Mark as:

More Like This

  • Retrieving data ...

Bookmarked By (0)

Answers + Points = Status

  • 10 points awarded for Correct Answers
  • 5 points awarded for Helpful Answers
  • 10,000+ points
  • 1,001-10,000 points
  • 501-1,000 points
  • 5-500 points