Skip to main content
June 5, 2006
Question

Calling CFC Method With AJAX

  • June 5, 2006
  • 3 replies
  • 559 views
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="+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
This topic has been closed for replies.

3 replies

Inspiring
June 6, 2006
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
>


June 5, 2006
My Friend may I ask you which Ajax lib. you are using first?

Thank you
Al
Inspiring
June 5, 2006
> 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
June 5, 2006
Well more specificlly its "Not Working" .