cfajaxproxy and Ajax to work with verifyclient function

328 Views Asked by At

I want to implement verifyclient in some functions in a cfc. I am aware that the follow syntax will works, but I don't know how to implement it within a ajax call. Example:

<cfajaxproxy cfc="cfc.cls_queries" jsclassname="cls_queries">

<script type="text/javascript">
  var cfcQuery = new cls_queries(); // reference the cfc object

  ..some functions....()

</script>

And I have another piece of code where I'm using plain Ajax as follow:

$.ajax({
   async:    false,
   type:     "POST",
   url:      "resources/cfc/cls_queries.cfc",
   dataType: "json",
   data: {
      method: "get_someInformation",
      cidm: lv_userID
   },
   success: function(data){}
});

How can I replace the url, data{method, and parameters} with the object (cfcQuery) that reference the cfc?

1

There are 1 best solutions below

0
Pankaj On

As David mentioned. You may use the following code to make the ajax call:

<cfajaxproxy cfc="cfc.cls_queries" jsclassname="cls_queries">
<script type="text/javascript">
    var cfcQuery = new cls_queries();
    var result = cfcQuery.get_someInformation(cidm = lv_userID);
</script>