How do I relay dynamic parameters passed into a functionA() to functionB() called within functionA()
<p>I'm trying to relay dynamic parameters from a web page into a function, which then passes them to a call inside the function. For example, take the simplified snippet below, as it is now, passing in the parameters directly is not problem. But how do I pass in a parameter which colorbox accepts without making a parameter for showColorbox() for every possible colorbox parameter? </p>

<pre><code>function showColorbox(title, url, width, height, modal, params) {

    $.colorbox({title:title, href:url, width:width, height:height, opacity:0.7});

}
</code></pre>

<p>For instance, colorbox accepts passing in an event function, such as below if I called colorbox directly:</p>

<pre><code>    $.colorbox({title:title, href:url, width:width, height:height, opacity:0.7, 
                onComplete: function() {
                                 $.colorbox.resize();
                             } 
              });
</code></pre>

<p>So, without adding some code or making another parameter and parsing it out somehow inside showColorbox(), is there a way for me to pass the onComplete param/code [via showColorbox(....{onComplete:yada yada}) or something] and have them relayed to the $.colorbox() function?</p>

<p>UPDATE:
Ended up using the following successfully, added an extra objParams parameter to the showColorbox() function.</p>

<pre><code>//m_title, m_url, m_width, m_height are from fixed parameters for showColorbox()        
var objBase = {title:m_title,href:m_url,width:m_width,height:m_height} ;
var objFinal = {};

//add base parameters passed in directly, fixed params
for(var item in objBase) {
    objFinal[item] = objBase[item];
}       
//add the parameters from objParams passed in (variable params/values)
for(var item in objParams) {
    objFinal[item] = objParams[item]
}   

//call function with combined parameters in object      
$.colorbox(objFinal)
</code></pre>

<p>None of the callers needed to be updated, but now passing in a new object using parameters which $.colorbox understands works fine!  Thanks again!</p>
