Skip to main content
October 23, 2013
Question

CFC 403 Forbidden Error

  • October 23, 2013
  • 1 reply
  • 6799 views

I am trying to invoke a CFC via a URL:

$(function () {

    'use strict';

    // Load countries then initialize plugin:

    $.ajax({

           url: 'https://....countries.cfc?method=getCountries',

       // url: '/autocomplete/content/countries.txt',

        dataType: 'json'

    }).done(function (source) {

        var countriesArray = $.map(source, function (value, key) { return { value: value, data: key }; }),

            countries = $.map(source, function (value) { return value; });

And get the following error:

NetworkError: 403 Forbidden -

Any help in fixing this would be appreciated.

    This topic has been closed for replies.

    1 reply

    Participating Frequently
    October 23, 2013

    What happens if you try and access that URL directly in your browser, rather than trying to load it in via AJAX?

    October 23, 2013

    I get the same error

    403

    Forbidden
    Legend
    October 23, 2013

    403 is not a ColdFusion error as such, it is a web server error. Therefore, the resource in question has an access issue e.g. IP block, permission issue, or other security-related issue that is stopping access. The error is also given sometimes when a resource URL cannot be opened. You need to look at that CFC and see where it goes wrong. Debug it line by line and put break points in to see where it gets to before the error is given. Check file paths, any rewrites, and server security settings for the resource. Can you call some code in the CFC before it errors? You have to be Sherlock Holmes sometimes