• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

404 error for cfc via AJaX

LEGEND ,
Jul 27, 2015 Jul 27, 2015

Copy link to clipboard

Copied

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,

^_^

Views

487

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Engaged ,
Jul 27, 2015 Jul 27, 2015

Copy link to clipboard

Copied

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

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Jul 27, 2015 Jul 27, 2015

Copy link to clipboard

Copied

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

^_^

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Jul 28, 2015 Jul 28, 2015

Copy link to clipboard

Copied

I checked the permissions, and both .cfc files are identical as far as permissions go.

V/r,

^_^

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Jul 28, 2015 Jul 28, 2015

Copy link to clipboard

Copied

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,

^_^

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Advocate ,
Jul 28, 2015 Jul 28, 2015

Copy link to clipboard

Copied

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

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Jul 28, 2015 Jul 28, 2015

Copy link to clipboard

Copied

LATEST

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,

^_^

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Resources
Documentation