Creating javascript function with variable name and accessing it?
<p>i have a scenario where javascript function name needs to be  decided at run time. For simplicity assume i have function name in javascript variable and now i want to create the function using variable value. I went thru the link <a href="http://stackoverflow.com/questions/3733580/javascript-variable-in-function-name-possible">Javascript - Variable in function name, possible?</a>  and tried the small code snippet</p>

<pre><code>   &lt;HTML&gt;
       &lt;HEAD&gt;
          &lt;TITLE&gt; New Document &lt;/TITLE&gt;
      &lt;/HEAD&gt;
        &lt;script&gt;
        var temp1='at_26';
        temp1: function() {alert("Inside 26"); }
        &lt;/script&gt;
         &lt;BODY&gt;
            &lt;a href="javascript:window[at_26]()"&gt;Copy Text&lt;/a&gt;
         &lt;/BODY&gt;
    &lt;/HTML&gt;
</code></pre>

<p>But when i click on hyperlink Copy Text it gives error saying <strong>Line: 1
Error: 'at_26' is undefined</strong></p>
