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 309765
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 12, 20262026-05-12T07:46:18+00:00 2026-05-12T07:46:18+00:00

I am using Ajax with ModelGlue in a ColdFusion Application. I want to make

  • 0

I am using Ajax with ModelGlue in a ColdFusion Application. I want to make an Ajax call to return a value. I do not want to render any view. I just want a database interaction and bring back a value.

My Ajax call:

new Ajax.Request(root+'test.testFunction',{
  method: 'post',
  parameters: {param1:paramval},
  onSuccess: function(response){
    alert(response.responseText);
    var myresult = response.responseText;
  }
});

my modelglue event :

<event-handler name="test.testFunction">
     <broadcasts>
          <message name="testFunction" />
     </broadcasts>
</event-handler>

and my controller function:

<cffunction name="testFunction" returnType="any" output="true" >
     <cfargument name="event" type="any" required="true">
        <cfset justtest = 1>
     <cfreturn justtest>
</cffunction>   

I am using prototype as my ajax library.

When i alert the responseText i am getting null value. Is this bcoz i have not included the view part in the event handler? If i included the view part then i wud have to create a new page which i dont want to do. Is it possible to get just a server value by ajax call without rendering any view?
I want to have myresult value as 1 according to the above scenario.

Pls help. Thnx for any help.

  • 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-05-12T07:46:19+00:00Added an answer on May 12, 2026 at 7:46 am

    Try using this at the end of your controller function:

    <CFCONTENT TYPE="text" RESET="Yes"><CFOUTPUT>#serializeJSON(justTest)#
    <cfset request.modelGlueSuppressDebugging = true />
    <cfsetting showdebugoutput="false" /></CFOUTPUT><cfabort>
    

    So like this:

    <cffunction name="testFunction" returnType="any" output="true" >     
    <cfargument name="event" type="any" required="true">        
    
    <cfset justtest = 1>
    
    <CFCONTENT TYPE="text" RESET="Yes"><CFOUTPUT>#serializeJSON(justTest)#
    <cfset request.modelGlueSuppressDebugging = true />
    <cfsetting showdebugoutput="false" /></CFOUTPUT><cfabort>
    
    </cffunction>
    

    This will keep your current view and return ‘justTest’ as a json.

    If you are using firefox you should be able to see the reponse from the server.

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

Sidebar

Related Questions

I'm using $.post() to call a servlet using Ajax and then using the resulting
Anyone have any experience creating a modal dialog box using AJAX and ASP.NET MVC?
Im using ajax to call php which gets results from a mysql db. Reason
If you are using Ajax.BeginForm() with multiple submit buttons similar to this: // View.aspx
I am confused about using ajax or jquery so I want to know what
Im using Ajax to send values to a PHP script which writes some value
I am using AJAX/JSON combination in Zend Framework. Whenever I click any link in
I got videos list using AJAX, and me want to play a top video
Im using ajax call to insertmsg.php to insert a message. Now javascript isn't a
When using views without Ajax, it's easy to access the $view->result array using hook_views_pre_render().

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.