Click here to Skip to main content
16,012,223 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
Hi everybody. I want to display funtion javascript include dll as Ajaxcontrol toolkit. when i write funtion, it show all functions to option as c#.

Eg. i wrote funtion $get.

JavaScript
$


it will show all funtion options

JavaScript
$create
$find
....


could you guide how to do.

Thank every boby
Posted
Comments
Sergey Alexandrovich Kryukov 18-Feb-15 1:41am    
Not clear at all. Of course, you can show/dump a function. But what does it mean, function options? What is that "code sample" with sole '$' in the single line? Do you really understand yourself what you are trying to achieve?
—SA

1 solution

The question is quite unclear — please see my comment to it.

However, I hope my explanations on how to "show" any function can help you. Functions are first-class citizen in JavaScript, they are objects with all properties of all other objects, but of special "function" type. All objects can be dumped, represented as string. For example:
Create some function object:
JavaScript
var f = function() { return x + 1; }

Instead of calling it, you can show it:
JavaScript
alert(f);
// will show: function () { return x + 1; }
Why it works? Because the function object is implicitly represented as string. You can do it directly, too:
JavaScript
var s = f.toString(); // now s === "function () { return x + 1; }"

or even like this:
JavaScript
var s = '' + f;


I hope you got the idea.

—SA
 
Share this answer
 
v3

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900