Results 1 to 3 of 3
  1. mfive's Avatar
    186 Posts
    Global Posts
    193 Global Posts
    Hey gang,

    I'm trying to get this f'ing Ajax.Request to work and I'm baffled as to why it's not working...

    I've used Ajax.Request in other places in my previous apps but I can't get it to work for some reason here.

    I can't post my entire source code for this project, as it's going into the official app catalog (I hope), but I was hoping you guys can help still. Here's my code, very simple, it's not even doing anything with the data yet!"Getting Data");
    var url = "";"Complete URL is: ", url);

    var request = new Ajax.Request(url,
    method: "get",
    evalJSON: "false",
    onSuccess: function(transport) {"Great Success!"); },
    onFailure: function(transport) {"Failure!"); }

    The above code doesn't execute either a success or failure log. It doesn't seem to do much of anything, and it continues right onto the next block of code which executes fine... It seems that my syntax is all right, and if I test my url that I use in the app, I get back the response just fine. (All it does is return one word...).
  2. kesne's Avatar
    471 Posts
    Global Posts
    491 Global Posts
    This should do the trick. Don't set the get's through the URL, use the Ajax.request parameters. If you need anymore help, feel free to ask.

    Code:"Getting Data");
    var glUrl = "";
    new Ajax.Request(glUrl, {
        method: 'get',
    	parameters: {test: this.test},
        onComplete: function(){},
        onSuccess: function (transport) {"Das ist gut!"); },
        onFailure: function (failure) {"Nicht so gut!"); }
  3. mfive's Avatar
    186 Posts
    Global Posts
    193 Global Posts
    Executes perfectly, hopefully this post will help someone else too!

Posting Permissions