<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta content="text/html; charset=ISO-8859-1"
http-equiv="Content-Type">
</head>
<body bgcolor="#ffffff" text="#000000">
Remember 'same domain' includes same port. <br>
<br>
If you have two servers on the same host and it isn't working for
you because on is on a different port, you can try something like
this in your Apache config:<br>
<br>
RewriteEngine ON<br>
RewriteRule ^/ajax/(.+) <a class="moz-txt-link-freetext" href="http://localhost:3000/$1">http://localhost:3000/$1</a> [P,L] <br>
<br>
There all requests to loalhost/ajax get redirected to
localhost:3000, which might be your Catalyst app server with
View::JSON. No need for JSONP then.<br>
<br>
HTH<br>
Lee<br>
<br>
On 29/04/2011 14:10, Oroszi, Róbert wrote:
<blockquote
cite="mid:BANLkTim9cUreOpz+sNbaDtFdZixXBGnpdw@mail.gmail.com"
type="cite">Dmitry, you should return JSONP only for
<meta http-equiv="content-type" content="text/html;
charset=ISO-8859-1">
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
moz-do-not-send="true" href="mailto:dim0xff@gmail.com">dim0xff@gmail.com</a>></span><br>
<blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt
0.8ex; border-left: 1px solid rgb(204, 204, 204);
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 class="h5"><br>
_______________________________________________<br>
List: <a moz-do-not-send="true"
href="mailto:Catalyst@lists.scsys.co.uk">Catalyst@lists.scsys.co.uk</a><br>
Listinfo: <a moz-do-not-send="true"
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 moz-do-not-send="true"
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 moz-do-not-send="true"
href="http://dev.catalyst.perl.org/" target="_blank">http://dev.catalyst.perl.org/</a><br>
</div>
</div>
</blockquote>
</div>
<br>
</div>
<pre wrap="">
<fieldset class="mimeAttachmentHeader"></fieldset>
_______________________________________________
List: <a class="moz-txt-link-abbreviated" href="mailto:Catalyst@lists.scsys.co.uk">Catalyst@lists.scsys.co.uk</a>
Listinfo: <a class="moz-txt-link-freetext" href="http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst">http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst</a>
Searchable archive: <a class="moz-txt-link-freetext" href="http://www.mail-archive.com/catalyst@lists.scsys.co.uk/">http://www.mail-archive.com/catalyst@lists.scsys.co.uk/</a>
Dev site: <a class="moz-txt-link-freetext" href="http://dev.catalyst.perl.org/">http://dev.catalyst.perl.org/</a>
</pre>
</blockquote>
</body>
</html>