Skip to main content
WolfShade
Legend
July 27, 2015
質問

404 error for cfc via AJaX

  • July 27, 2015
  • 返信数 2.
  • 699 ビュー

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,

^_^

    このトピックへの返信は締め切られました。

    返信数 2

    WolfShade
    WolfShade作成者
    Legend
    July 28, 2015

    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,

    ^_^

    Inspiring
    July 28, 2015

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

    WolfShade
    WolfShade作成者
    Legend
    July 28, 2015

    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,

    ^_^

    Dave Ferguson
    Participating Frequently
    July 27, 2015

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

    WolfShade
    WolfShade作成者
    Legend
    July 27, 2015

    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.)

    ^_^