Javascript config file with business logic for all user actions
===

My question may be little confuse you.

Actually I am searching internet for a standard technology to do the below:

1. Write a config file (JSON or .js) which includes all business logic.
2. Javascript will load that config file and it has to do all the actions specified in the config file.

Sample config file

    "loginConfig":
	[
		"#Submit-button",
		"click",
		{
			"perform": "LoginAction",
			"username":	"#input-username",
			"password":	"#input-password"
		}
	]

My requirement is, A javascript library should load this config file and it has to do the below actions

1. When 'Submit' button pressed
2. Read the input (text boxes) values from "#input-username" and "#input-password"
3. And call the function "LoginAction" with the values read from step 2.

I have written a simple .js file to read this config file and do the same action as described above, but I want to know whether this kind of approach (concept) already available or not.

Please help me.