troubleshooting Question

Multiple Instances of a CFFunction/CFComponent

Avatar of mudbuggle
mudbuggleFlag for United States of America asked on
AJAXColdFusion LanguageJavaScript
6 Comments3 Solutions977 ViewsLast Modified:
I am having an issue calling multiple instances of a cffunction. The problem is I intermittenly get null is null errors and some of the data is jumbled. The strange part is the issue is occurring with seperate functions as well.  Any assistance would be greatly appreciated.
I have posted a simplified example of how I am calling the functions below.
I can post the actual code if needed.
example:
<cfcomponent>
<cffunction name="getMenu" returntype="query" access="remote">
<cfaurgument name="menu" required="true">
<cfquery name="getmenu" datasource="someDB">
     SELECT Title, id
     FROM someTable
     WHERE id = #menu#
</cfquery>
<cfreturn getmenu>
</cffunction>
</cfcomponent>
 
<html>
<head>
<script language="javascript" type="text/javascript">
function setMenu(obj)
{
     var params = new Object();
     params.Item = obj;
     http('POST','url.cfc?method=getMenu',makeMenu,params);
}
 
function makeMenu(obj)
{
     for(i=0;i<obj.id.length;i++)
     {
          var alter = document.getElementById(obj.id[i]);
          alter.innerHTML = ob.title[i];
     }
}
</script>
</head>
<body onload="setMenu(1);setMenu(2);setMenu(3);setMenu(4)">
     <div id="1"></div>
     <div id="2"></div>
     <div id="3"></div>
     <div id="4"></div>
</body>
</html>
ASKER CERTIFIED SOLUTION
azadisaryev

Our community of experts have been thoroughly vetted for their expertise and industry experience.

Join our community to see this answer!
Unlock 3 Answers and 6 Comments.
Start Free Trial
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 3 Answers and 6 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros