How do I pass a PHP array to a jQuery function?
<p>I have a jQuery function that opens a modal popup and I have in the same file a variable in PHP like <code>$url="iteminfo.php?ID=".$i['itmid'];</code>(<code>$i['itmid']</code> is the id of some products from MySQL). The jQuery function looks like this:</p>

<pre><code>&lt;script type="text/javascript"&gt;

  $(document).ready(function(Surl) {

    var source="iteminfo.php?ID=&lt;?echo $i['itmid']?&gt;";
    var width = 920;
    var align = "center";
    var top = 100;
    var padding = 10;
    var backgroundColor = "#FFFFFF";
    var borderColor = "#000000";
    var borderWeight = 4;
    var borderRadius = 5;
    var fadeOutTime = 300;
    var disableColor = "#666666";
    var disableOpacity = 40;
    var loadingImage = "js/popup/loading.gif";

    $(".modal").click(function() {

        modalPopup( align,
            top,
            width,
            padding,
            disableColor,
            disableOpacity,
            backgroundColor,
            borderColor,
            borderWeight,
            borderRadius,
            fadeOutTime,
            source,
            loadingImage );

    }); 

    $(document).keyup(function(e) {
        if (e.keyCode == 27) {
            closePopup(fadeOutTime);
        }
    });

  });

&lt;/script&gt;
</code></pre>

<p>It opens the respective links but the function open all of them like in a loop. How can I pass the <code>$url</code> into the jQuery function to open the respective link for the respective product?</p>
