Is that possible to get a function name in Javascript
Generally it is impossible but some guy done that with a informal way
<Script>
var varx = {
addChild: function Wlc_Framework_UI_UIGroup$addChild(child) {
var x = "hello dfsalkfj kasfj"
}
}
var pat = /[\(\{\n\r].*?[\)\}\n\r]/g
try {
alert(varx.addChild.toString().replace(pat,""))
}catch(ex){alert(ex.message);}
</script>
<Script>
var varx = {
addChild: function Wlc_Framework_UI_UIGroup$addChild(child) {
var x = "hello dfsalkfj kasfj"
}
}
var pat = /[\(\{\n\r].*?[\)\}\n\r]/g
try {
alert(varx.addChild.toString().replace(pat,""))
}catch(ex){alert(ex.message);}
</script>
Labels: coding, javascript