I have a variable
var functionName="giveVote";
What I need to do, I want to call a function stored in var functionName . I tried using functionName () ;, but this does not work. Please, help.
Change For the same issue, I have
$(this).rules("add", {txtInf: "^[a-zA-Z'.\s]{1,40}$" });
rules is a differentiated function that takes the Name: method, here I have hardcoded txtInf. But I want to specify a javascript variable here to make my code shared. var methodName = "txtInf";
Here I want to first evaluate the name of a method before using it in a rule function.
$(this).rules("add", {mehtodName: "^[a-zA-Z'.\s]{1,40}$" });
javascript function jquery
Vaibhav jain
source share