Calling function defined in an object
<p>I have an object that defines the name and parameters of a function to be called in the click event of a page element.</p>

<pre><code>object_array = [
    {
       id: "id1",
       onclick: "load_file(filename.php);",
    },

    {
       id: "id2",
       onclick: "open_url('http://url.com');",
    }
];
</code></pre>

<p>That information must be retrieved dynamically.  I'd like in the click event to call the onclick function for a given object in the array.</p>

<pre><code>$('element').click(function() {
      // call object.onclick
});
</code></pre>

<p>Seems that eval() is not a good choice.  Is there a different way of calling that function?</p>
