DarkMantis
DarkMantis

Reputation: 1

jQuery AJAX help

I am new here, and I have looked at the other Ajax Help topics, however, I still can't see why mine isn't working.

Here it is:

$(document).ready(function(){
    $.ajax({
        type: "GET",
        url: "localhost/val.php",
        data: "val=RichieC",
        success: function(msg){
            alert("WOO");
        }
    });
});

Has anyone got any ideas? I've tried a few things!

Thanks!

Upvotes: -1

Views: 72

Answers (2)

Samo
Samo

Reputation: 8240

Did you debug val.php and verify that your server side code is running when you make the AJAX call? If your action is executing, you can make sure everything is working as expected by just stepping through (or alternatively, as Quintin Robinson suggested, you could add a failure callback to see if that is being called).

If your action is doing what you think it should do and still no callbacks are firing, well, that one's a toughie :)

Upvotes: 1

Try putting http://localhost/val.php in the url. The way it is now will look for a localhost folder in the current directory.

Upvotes: 4

Related Questions