[rt-users] Using Ajax with Mason in RT

Martin Drasar drasar at ics.muni.cz
Thu Aug 16 05:22:20 EDT 2012


Hi,

it appears I've reached a dead end...

This is my javascript ajax call (practically identical to the one Paul
posted):

> jQuery.ajax
> (
>   {
>     type: 'POST',
>     url:  'Elements/TestComponent',
>     data:
>     {
>       'ip': ip
>     },
>     dataType: 'json',
>     traditional: true,
>     success: successCallback,
>     error:   errorCallback
>   }
> );

According to Tamper Data, it gets sent and it looks like it contains the
right data.

This is my component:

> % $r->content_type('application/json');
> <% JSON( \@something ) |n %>
> % $m->abort();
> 
> <%init>
> my @something;
> push (@something, 'something');
> </%init>
> 
> <%flags>
> inherit => undef;
> </%flags>

The problem is, when I remove the flags section, the ajax call fails
with 403. If I keep it, I get back following error: "syntax error at
/home/RT/RT-4.0.6/local/html/Ticket/Elements/TestComponent line 15, at EOF"

Anyone got any idea?

Thanks,
Martin



More information about the rt-users mailing list