Calling a CFC function in AJAX/JQuery

陌路散爱 提交于 2020-01-04 12:18:29

问题


I would like to call a cfc function that I created that will take an input, and based on that input, mark a bit field on a MSSQL database. It's something I'm not too familiar with, but looks something like this.

Agendalist CFC

<cffunction name="iTalked">
    <cfargument name="SpeakerName" required="true" type="string">
        <cfquery name="iTalked" datasource="SpeakerCard">
            UPDATE tbl_SpeakerCard_Log
            SET Spoken = 1
            WHERE SpeakerName = '#SpeakerName#'
        </cfquery>
    <cfreturn iTalked>
</cffunction>

AJAX Call

function HasSpoken(name)
    {
        $.AJAX('actions.AgendaList.cfc?wsdl', {method : 'iTalked', SpeakerName: name});
    }

I'm pretty sure my Ajax call is incorrect in some form, but I'm not well versed enough to understand what the error is. if you can offer any help I'd appreciate it. TIA!

来源:https://stackoverflow.com/questions/31279865/calling-a-cfc-function-in-ajax-jquery

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!