Hi all,

I perform the following call in jQuery in a page:

        $.post( "test-ajax",
                function( data ) {
                    alert( "Data Loaded: " + data);
                });


The test-ajax page gets called via the url-dispatcher:

  (define-values (site-dispatch site-url)
                 (dispatch-rules
                   ...
                   [("test-ajax") ajax]))

and the ajax function is simply this:

  (define (ajax req)
    (response/xexpr
        "1 "))

Nonetheless, the above Ajax call fails with a 404 error, but when I replace
$.post by $.get, it works. As far as I can tell, the only thing about the
request this changes it the method, from POST to GET.

Is there a reason this fails? Do I need to tell the webserver that it
should serve both POST and GET?

Btw, the reason I want to use post is that when I use get, the data I send
with the request gets put at the end of the url (../test-ajax?some-binding)
and I couldn't figure out how to have the dispatcher deal with this problem
(that returned an error 500).

Thanks,

Marc

-- 
You received this message because you are subscribed to the Google Groups 
"Racket Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to racket-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to