T.T.T.
T.T.T.

Reputation: 34513

jQuery.post() not going through?

On button click I have the simple jQuery post:

$(document).ready(function() {
    $.post("/cgi-bin/stats.exe");
});

However, nothing seems to go through to the server side. Any suggestions?

Thanks.

Upvotes: 0

Views: 87

Answers (1)

Fitzchak Yitzchaki
Fitzchak Yitzchaki

Reputation: 9163

You attaching it to the document ready event. Instead, you should attach is to your button.

$(document).ready(function() {
     $('#myButtonId').click(function(){
           $.post("/cgi-bin/stats.exe");
     });
});

Upvotes: 3

Related Questions