Welcome Guest, Not a member yet? Register   Sign In
Needing access from Javascript to PHP file
#4

[eluser]Jay Turley[/eluser]
Try using relative URLs; from some working code:

Code:
jQuery.ajax({
    type: "POST",
    url: "/index.php/map/add_item",
    data: newItemData,
    dataType: "json",
    success: function(data,textStatus){
        if ( ! data.success || data.success == 'false' ) {
            // do failure stuff
        } else {
            // do success stuff
        }
    },
    error: function(XMLHttpRequest, textStatus, errorThrown) {
        if (textStatus == 'timeout') {
            // show network error
        } else {
            // show unknown error
        }
    }
});

I've never had a problem with using the relative urls. If this doesn't work, can you look in your console or echo the URI to the page so we can see *exactly* what the URI turns out to be?


Messages In This Thread
Needing access from Javascript to PHP file - by El Forum - 01-15-2009, 05:06 PM
Needing access from Javascript to PHP file - by El Forum - 01-15-2009, 05:28 PM
Needing access from Javascript to PHP file - by El Forum - 01-15-2009, 05:43 PM
Needing access from Javascript to PHP file - by El Forum - 01-15-2009, 05:51 PM
Needing access from Javascript to PHP file - by El Forum - 01-15-2009, 06:22 PM
Needing access from Javascript to PHP file - by El Forum - 01-16-2009, 03:19 AM



Theme © iAndrew 2016 - Forum software by © MyBB