AJAX request from velocity template to a Webwork Action

Hey!

I have a webwork action that should be the target of an ajax call. the webwork action runs as it should when I call it directly in the browser.

I use this code inside another velocity template to call the action and get the data:

<script language="JavaScript">
    $(function() {
        AJS.$.ajax({
            url: "/jira/DataLoader.jspa",
            type: "GET",
            data: ({mail : "$mail", token: "$token"}),
            dataType: "html",
            success: function(response){
                $("#customer-data-container").html(response);
            }
        });
    });
</script>
<div id="customer-data-container">
</div>

However, I just always get an exception and I don’t know why:

Parser Exception: templates/customerdetails.vm
[INFO] [talledLocalContainer] org.apache.velocity.runtime.parser.ParseException: Encountered "{" at line 3, column 20.
[INFO] [talledLocalContainer] Was expecting one of:
[INFO] [talledLocalContainer]     <EOF>
[INFO] [talledLocalContainer]     "(" ...
[INFO] [talledLocalContainer]     <RPAREN> ...
[INFO] [talledLocalContainer]     <ESCAPE_DIRECTIVE> ...
[INFO] [talledLocalContainer]     <SET_DIRECTIVE> ...
[INFO] [talledLocalContainer]     "##" ...
[INFO] [talledLocalContainer]     "\\\\" ...
[INFO] [talledLocalContainer]     "\\" ...
[INFO] [talledLocalContainer]     <TEXT> ...
[INFO] [talledLocalContainer]     "*#" ...
[INFO] [talledLocalContainer]     "*#" ...
[INFO] [talledLocalContainer]     <STRING_LITERAL> ...
[INFO] [talledLocalContainer]     <IF_DIRECTIVE> ...
[INFO] [talledLocalContainer]     <STOP_DIRECTIVE> ...
[INFO] [talledLocalContainer]     <INTEGER_LITERAL> ...
[INFO] [talledLocalContainer]     <FLOATING_POINT_LITERAL> ...
[INFO] [talledLocalContainer]     <WORD> ...
[INFO] [talledLocalContainer]     <BRACKETED_WORD> ...
[INFO] [talledLocalContainer]     <IDENTIFIER> ...
[INFO] [talledLocalContainer]     <DOT> ...
[INFO] [talledLocalContainer]     "{" ...
[INFO] [talledLocalContainer]     "}" ...