How can I use a passed parameter in a JavaScript function?
<p>Forgive the <em>complete</em> newbie question here - I <em>know</em> this is really basic stuff, but for the life of me I can't figure it out.  Javascript is relatively new to me, and this is the first time I've had to do this particular thing.</p>

<p>So, I'm trying to use a Modal to open an iframe - the page itself will have links to several modals, all of which need to be passed a different value.  Rather than hardcode each of these, I'm trying to set it up in such a way that one function can be used and the links can pass the values as required.</p>

<p>The code I currently have successfully opens the modal, but a 404 error is inside it - plus the modal title shows + title + - so I guess I'm referencing it wrong (probably in the function?).</p>

<p>Heres what I've got, pointers in the right direction would be appreciated!</p>

<pre><code>function openIframe(title,url){
    $.modal({
        title: '+title+',
        url: '+url+',
        useIframe: true,
        width: 600,
        height: 400
    });
}
</code></pre>

<p>.. and the link:</p>

<pre><code>&lt;a href="#" onclick="openIframe('Process Voucher','a_processvoucher.cfm')"&gt;Add&lt;/a&gt;
</code></pre>
