Posted: 6/9/2010
Hi Experts,
I need to print the source code a function. I know how to execute the function but I dont know how to print the source code of this function.
duplicate post
What language?
I see you have posted about printing all properties of a n Object in JavaScript language where I already wrote an answer. Do you want to do this for JavaScript again or???
Im not sure if you are going to be able to do that easily.
Maybe you want to make something like source code snippets, showing the html code on html page?
Example:
<pre> <code> <html> <body> page content </body> </html> </code> </pre>
Result:
<html> <body> page content </body> </html>
using < for < and > for > you can escape the special characters. Try it
Posted: 6/11/2010
There is tostring() method for it. Try this sample code:
<html xmlns="http://www.w3.org/1999/xhtml"> <head runat="server"> <title></title> <script type="text/javascript"> function test() { alert('This is my test string'); } alert(test.toString()); </script> </head> <body> </body> </html>