4 Replies Latest reply on Jun 6, 2006 9:06 AM by Newsgroup_User

    Calling CFC Method With AJAX

    flooker
      Hello Guys , I am trying to call Component method using AJAX but its not working , Here is the Code i am using . In Code REC.OPEN is giving Trouble. Is this a Proper way to call Function ?

      function Process_Calendar(day,month,year,name){

      var hello = document.getElementById(name);
      hello.innerHTML = day+'<img src="../../Content/Graphics/images.jpg">';

      if (window.XMLHttpRequest)
      {

      req = new XMLHttpRequest();
      }
      else if (window.ActiveXObject){

      req = new ActiveXObject("Microsoft.XMLHTTP");

      }


      req.open("getNoCache","BaseFunc.cfc?Method=Insertme&month="+month+"&day="+day+"&year="+ye ar+"&ms="+new Date().getTime(),true);
      req.send("");

      if ((req.readyState == 4) && (req.status == 200)){
      var arr = req.responseText;
      hello.innerHTML = arr;

      }
      }

      Thanks a Lot
        • 1. Re: Calling CFC Method With AJAX
          Level 7
          > Hello Guys , I am trying to call Component method using AJAX but its not
          > working , Here is the Code i am using . In Code REC.OPEN is giving Trouble.
          >

          Wanna elaborate on "not working" and "trouble"?

          --
          Adam
          • 2. Re: Calling CFC Method With AJAX
            flooker Level 1
            Well more specificlly its "Not Working" .
            • 3. Re: Calling CFC Method With AJAX
              Al_Parvar
              My Friend may I ask you which Ajax lib. you are using first?

              Thank you
              Al
              • 4. Re: Calling CFC Method With AJAX
                Level 7
                This might be a stupid question, but do you have the method's access set to
                remote? You are calling it via HTTP.

                --
                Bryan Ashcraft (remove brain to reply)
                Web Application Developer
                Wright Medical Technologies, Inc.
                =============================
                Macromedia Certified Dreamweaver Developer
                Adobe Community Expert (DW) :: http://www.adobe.com/communities/experts/


                "flooker" <yousafriaz@hotmail.com> wrote in message
                news:e61jtu$o22$1@forums.macromedia.com...
                > Hello Guys , I am trying to call Component method using AJAX but its not
                > working , Here is the Code i am using . In Code REC.OPEN is giving
                > Trouble.
                >
                > function Process_Calendar(day,month,year,name){
                >
                > var hello = document.getElementById(name);
                > hello.innerHTML = day+'<img src="../../Content/Graphics/images.jpg">';
                >
                > if (window.XMLHttpRequest)
                > {
                >
                > req = new XMLHttpRequest();
                > }
                > else if (window.ActiveXObject){
                >
                > req = new ActiveXObject("Microsoft.XMLHTTP");
                >
                > }
                >
                >
                >
                > req.open("getNoCache","BaseFunc.cfc?Method=Insertme&month="+month+"&day="+day+
                > "&year="+year+"&ms="+new Date().getTime(),true);
                > req.send("");
                >
                > if ((req.readyState == 4) && (req.status == 200)){
                > var arr = req.responseText;
                > hello.innerHTML = arr;
                >
                > }
                > }
                >
                > Thanks a Lot
                >