0
votes

I am using ColdFusion 8.0.1 and jQuery 1.4.3

I am passing values to a jQuery function that calls a CFC.

The problem is that the function is being fired twice, and I can't figure out why. I looked over everything and I am not doing anything other than this code in query. When the CFC is first accessed, it succeeds, meaning the value is saved into an array and returns true. (I can see this in Firebug.) Then, the CFC is called again and just hangs out there and never returns anything.

I am using CFAJAXPROXYlike this:

<!--- CREATE AJAX PROXY --->
<cfajaxproxy cfc="avcat.udf.udf_library" jsclassname="jsApp">

My link looks like this:

<a class="AddToList" href="?" product="550695">add item to my list</a>

My jQuery looks like this:

// ADD ITEM LINK WAS CLICKED
$(".AddToList").click(function(event) {
   event.preventDefault();
   var Product_ID = $(this).attr("product");
   var jro = new jsApp();
   var Success = jro.updateUserProductArray(Product_ID);
 });

My CFC looks like this:

<cffunction name="updateUserProductArray" access="remote">
   <cfreturn true>
</cffunction>

In Firebug, the first call to the CFC returns true. The second call just hangs forever.

ANSWER

The webmaster had some extra code in place that reloaded the page if any characters were in upper case, which there were. We removed that unnecessary code of his and everything worked just fine.

1
With the above code, everything seems to work fine for me... I was using Coldfusion 9 with jquery 1.4.3 to test. May be you have your jquery code twice? - DG3
If you found your own answer, you should post the answer and accept it. - James Montagne
My answer was completely unrelated to the question. I did put the answer in the question. I guess I will create my own answer and accept it, if that's what you mean. - Evik James

1 Answers

2
votes

The webmaster had some extra code in place that reloaded the page if any characters were in upper case, which there were. We removed that unnecessary code of his and everything worked just fine.