Highlighted

access cfc component

Engaged ,
Mar 30, 2016

Copy link to clipboard

Copied

I create a cfc which has one method and want to access from cfm file using jQuery.

it seems that jQuery does not recognize the component,\

I remember that I can check if this component and method is accessible from my browser, but I do not remember how.

Your help and information is great appreciated,

Regards,

Sourises,

You can test the component by navigating to http://mysite.com:port/MyCFC.cfc?method=myMethod

Change the above URL to meet you environment.  For instance it might be something like http://localhost:8500/model/remoting.cfc?method=login

As a quick aside, make sure you have set the CFC access to "remote".

TOPICS
Getting started

Views

489

Likes

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

access cfc component

Engaged ,
Mar 30, 2016

Copy link to clipboard

Copied

I create a cfc which has one method and want to access from cfm file using jQuery.

it seems that jQuery does not recognize the component,\

I remember that I can check if this component and method is accessible from my browser, but I do not remember how.

Your help and information is great appreciated,

Regards,

Sourises,

You can test the component by navigating to http://mysite.com:port/MyCFC.cfc?method=myMethod

Change the above URL to meet you environment.  For instance it might be something like http://localhost:8500/model/remoting.cfc?method=login

As a quick aside, make sure you have set the CFC access to "remote".

TOPICS
Getting started

Views

490

Likes

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
Mar 30, 2016 0
Engaged ,
Mar 30, 2016

Copy link to clipboard

Copied

You can test the component by navigating to http://mysite.com:port/MyCFC.cfc?method=myMethod

Change the above URL to meet you environment.  For instance it might be something like http://localhost:8500/model/remoting.cfc?method=login

As a quick aside, make sure you have set the CFC access to "remote".

Likes

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
Reply
Loading...
Mar 30, 2016 1
LEGEND ,
Mar 31, 2016

Copy link to clipboard

Copied

If you are using a form to submit via AJaX to a CFC:

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

    e.preventDefault(); // prevents form from standard submit

    var $formData = $('#formName').serializeArray(); // Since this is submitting via AJaX, the submit button will not be included in the form scope

    var $urlData = "//www.domain.com/components/myCFC.cfc?method=myFunction"; //As nic pointed out, change this to fit your environment

    $.ajax(

        url: $urlData,

        data: $formData

        )

        .done(

           // Process code for successful action

                );

    });

This is what I typically use.  Different scenarios have different settings.

HTH,

^_^

Likes

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
Reply
Loading...
Mar 31, 2016 1
iccsi LATEST
Engaged ,
Mar 31, 2016

Copy link to clipboard

Copied

Thanks a million for helping and information,

Regards,

Sourises,

Likes

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
Reply
Loading...
Mar 31, 2016 0