Skip to main content
WolfShade
Legend
Jul 27, 2015 7:40 PM UTC
Question

404 error for cfc via AJaX

Hello, all,

I've got three forms that are submitting form data via AJaX to a CFC and it's working GREAT!

I've got ONE form that I'm trying to do the same thing, but FireBug is returning a 404 error.  I've checked the http path, and it is correct.  But the AJaX function that is submitting the data keeps erroring with a 404.

Any thoughts on what might prevent AJaX from finding one CFC, but not the other?

V/r,

^_^

    This topic is closed to new replies. Start a new post to keep the conversation going.

    6 replies

    WolfShade
    WolfShadeAuthor
    Legend
    Jul 28, 2015 1:49 PM UTC

    I have NO idea what just happened.

    I changed the JS from this:

    $('#submitBtn').on('click',function(e){

        frm = $('#estimateForm');

        frm = frm.serializeArray();

        postURL = 'http://www.domain.com/components/ERC.cfc?method=getCostEstimate';

        $.ajax({

            type: 'post',

            url: postURL,

            data: frm

    }).done(function(data){alert(data)});

    .. to this..

    $('#submitBtn').on('click',function(e){

        postData = $('#estimateForm').serializeArray();

        postURL = 'http://www.domain.com/components/ERC.cfc?method=getCostEstimate';

        $.ajax({

            type: 'post',

            url: postURL,

            data: postData

    }).done(function(data){alert(data)});

    .. and it is now working.

    Any thoughts on what was going wrong?  I don't get it.

    V/r,

    ^_^

    Translate
    Inspiring
    Jul 28, 2015 2:23 PM UTC

    Have you left out code? This is invalid javascript. You have brackets missing. The closing brackets for the .on function are missing.

    Translate
    WolfShade
    WolfShadeAuthor
    Legend
    Jul 28, 2015 3:33 PM UTC

    They are not missing in the actual document.  They are missing, here, because I have to manually type everything because my dev environment is isolated from the internet.  Those slipped my mind as entered.  And I don't have CD burn permissions and flash/thumb drives are disabled (and will trigger an alert to network admins who have MPs on speed dial.)

    V/r,

    ^_^

    Translate
    Dave Ferguson
    Participating Frequently
    Jul 27, 2015 7:45 PM UTC

    Is it possible that you have either a case sensitivity issue or a permissions issue?

    Translate
    WolfShade
    WolfShadeAuthor
    Legend
    Jul 27, 2015 7:52 PM UTC

    Hi, fergusondj‌, thanks for your reply.

    The files are all uploaded via the same FTP account into folders that are given appropriate permissions, so a permission issue is unlikely.  I'll see if any are showing different.

    The naming convention for the CFC files is ALL_UPPERCASE.cfc, and they are all following that convention (NEWS.cfc, PUBLIC.cfc, etc.)

    ^_^

    Translate