2 Replies Latest reply on Jun 28, 2009 1:53 PM by CF_Ali

    cfajaxproxy help..


      I have trouble getting ajax to work on my application. I am using cfajaxproxy tag and I keep getting an error of "exception thrown but not caught". I am trying to get results back from the server of the query's recordcount. if its 0 then relocate the user, if its 1 then open a cfwindow..

      heres my code:

      <cfajaxproxy cfc="rem" jsclassname="rem"/>
      function checkname(name){
      var instance = new rem();
      function isfriend(res){
      if (res == 0)
      var locate = "test2.cfm?rel=";
      window.navigate(locate + name);}
      and here is my rem.cfc:

      <!-- function to check if friend or not -->
      <cffunction name="checkname" access="remote" returntype="numeric">
      <cfargument name="ref" type="numeric">
      <cfquery name="checkfriend" datasource="blog">
      SELECT friendshipid FROM friends WHERE
      UserID = #SESSION.IsLoggedIn.UserID#
      AND FriendID = #ARGUMENTS.ref#

      <cfreturn int(checkfriend.recordcount)>
      thank you everyone

        • 1. Re: cfajaxproxy help..
          BKBK Adobe Community Professional & MVP

          I would, for a start, define the functions as follows:


          var checkname = function(name) {...}
          var isfriend = function(res) {...}


          and I would call setErrorHandler, for example, like this




          Check out the live docs on cfajaxproxy

          • 2. Re: cfajaxproxy help..
            CF_Ali Level 1


            Thank you for the reply, but it didn't work. In fact, I thought it had somthing to do with the built in ajax files on the server, yet, when I moved both my document and the cfc to a new location on the server, magic happened and it all worked out just perfect. So, I really don't know what happened exactly, but I'm sure that it has to do with the cfajax.js files on the server some how. I would like to thank you again for the reply