jQuery event handler functions - how to pass my own parameter
<p>This is actual code, how do I pass <code>list[i].fnctn</code> correctly to the click handler?</p>

<p><code>list[i].fnctn</code> - Contains the name of the function that I want to attach to the click event handler.</p>

<pre><code>function createList(list){
    var parentID = $("#content_nav ul");
    var len = list.length;
    for(var i=0;i&lt;len;i++){
        var anchorElement = jQuery('&lt;a /&gt;',{text:list[i].text});
        var liElement = jQuery('&lt;li /&gt;',{"class":"navlink_"+(i+1),id:"navlink_"+(i+1)});
        //anchorElement.attr('onclick',list[i].fnctn+"()"); - Works fine on desktop browsers but doesn't work on mobile devices. (Mobile devices are my target platform

        anchorElement.on('click',function(event) {
            return window[list[i].fnctn](event); // Here I am getting the error - cannot access property fnctn of undefined
        });
        liElement.append(anchorElement);
        parentID.append(liElement);
    }
}
</code></pre>
