Thanks, Jay. I thought I was on the right track...just wanted a little sanity check before coding. :)<br><br><div class="gmail_quote">On Tue, Mar 2, 2010 at 4:44 PM, J. Shirley <span dir="ltr"><<a href="mailto:jshirley@gmail.com">jshirley@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"><div><div></div><div class="h5">On Tue, Mar 2, 2010 at 12:06 PM, Michael Peck <<a href="mailto:mapeck65@gmail.com">mapeck65@gmail.com</a>> wrote:<br>
> I'm writing a Greasemonkey script that incorporates JQuery, which I want to<br>
> POST JSON data to a catalyst application. The Catalyst application does not<br>
> exist within the same domain as the page the greasemonkey script is running<br>
> from, so I am assuming I will need to use Greasemonkey's GM_xmlhttpRequest<br>
> method to post the data. I am new to all of this, so I'm just trying to<br>
> make sure my thought process is correct.<br>
><br>
> On the client side, I think I should use JSON.stringify on the Javascript<br>
> object before posting it using GM_xmlhttpRequest to the Catalyst app.<br>
><br>
> On the Catalyst side, I'm planning to use Catalyst::Controller::REST, which<br>
> should deserialize the JSON data with Catalyst::Action::Deserialize::JSON,<br>
> if I understand it correctly.<br>
><br>
> If anyone has done anything similar, I could use some pointers, as I'm new<br>
> to Catalyst and haven't worked with JSON before.<br>
><br>
> Thanks,<br>
> Mike.<br>
><br>
<br>
</div></div>Assuming you can do the cross-domain xmlhttprequests with greasemonkey<br>
(I don't use Greasemonkey) then Catalyst::Controller::REST is what you<br>
are after.<br>
<br>
Just make sure that you send the "Content-type: application/json"<br>
header, and everything will work. I do this a lot with JSON, using<br>
yui3 though.<br>
<br>
-Jay<br>
<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>
</blockquote></div><br>