Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7791891
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T22:02:19+00:00 2026-06-01T22:02:19+00:00

I am using $.post() to send a json to my cfc, which updates some

  • 0

I am using $.post() to send a json to my cfc, which updates some records. I am not returning a json back to the calling page, I am just returning the contents of a variable that I am setting in the cfc. Based on the value of that variable, the update was/was not successful. I cannot seem to get at the contents of the variable. I just started using jQuery, so I think I’m doing it right, but apparently not.

the jQuery:

$("#edit_button").click(function(){
    if(theArray.length > 0){
        theJson = JSON.stingify(theArray);
        $.post("cfcs/fund_profile.cfc",{
            method:"updateProfile",
            data:theJson,
            dataType:"text"
            success:function(response){alert(response);}
        });
   }
});

I’m not going to post the whole cfc, just the important part.

I am just returning a string.

<cffunction name="updateProfile" ...>
    ...

    <cfif message neq ''>
        <cfreturn message>
    <cfelse>
        <cfset message = "success">         
    </cfif>
    <cfreturn message>
</cffunction>
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-01T22:02:21+00:00Added an answer on June 1, 2026 at 10:02 pm

    You are using $.post incorrectly. That looks like a mish-mash of $.ajax and $.post. Your call should resemble this:

    $.post("cfcs/fund_profile.cfc",{ method: "updateProfile", data: theJson}, 
        function(response) {
           alert(response);
        }, 
    "text");
    

    Docs: http://api.jquery.com/jQuery.post/

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am using $.post to send a json structure built out of user input:
From a webpage, I need to send JSON data using POST method to a
In my app, I have send some Request to server using POST Method and
i want to send my data in form of json to server using post
I'm using $.ajax asynchronously to send some json to a controller marked with [HttpPost],
I am trying to send data, in json format to my webservice, using POST.
I am trying to get send json from my javascript (using jquery post) to
I'm trying to send post using API feed. I set fields: message , link
when using http post with flash that send ip address request from client computer
I have a program to send POST request to a server. I'm using cURL

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.