Dmitry, you should return JSONP only for <meta http-equiv="content-type" content="text/html; charset=utf-8">crossdomain requests.<div>if you are on the same domain and port you can send JSON.</div><div><br><div class="gmail_quote">
2011/4/29 Dmitry L. <span dir="ltr"><<a href="mailto:dim0xff@gmail.com">dim0xff@gmail.com</a>></span><br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">Hi!<br>
<br>
Your controller must return JSONP data (not just JSON)<br>
<br>
jQuery send additional param to you controller ("callback" by default, I<br>
think)<br>
my $cb = $c->req->param("callback");<br>
<br>
So View::JSON should return something like this: $cb($data);<br>
Where $data is [{"value":"1","label":"betty"},{"value":"2","label":"jane"},<br>
{"value":"3","label":"marge"}]<br>
<br>
And Content-type header probably should be "application/javascript"<br>
<br>
Or look at jQuery.autocomplete manual to use JSON (instead of JSONP)<br>
<font color="#888888"><br>
--<br>
//wbr, Dmitry L.<br>
</font><div><div></div><div class="h5"><br>
_______________________________________________<br>
List: <a href="mailto:Catalyst@lists.scsys.co.uk">Catalyst@lists.scsys.co.uk</a><br>
Listinfo: <a href="http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst" target="_blank">http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst</a><br>
Searchable archive: <a href="http://www.mail-archive.com/catalyst@lists.scsys.co.uk/" target="_blank">http://www.mail-archive.com/catalyst@lists.scsys.co.uk/</a><br>
Dev site: <a href="http://dev.catalyst.perl.org/" target="_blank">http://dev.catalyst.perl.org/</a><br>
</div></div></blockquote></div><br></div>