Quick References
      ADO
      ASP
      CSS2
      HTML
      JavaScript
      Jet SQL
      VBScript
      WML
      WMLScript
      WSH
      XHTML
      XML DOM
      XSLT

Features
      Knowledge Base
      Tutorials

Partners
     ZVON.ORG
     XML
     Planet Source Code
     VisualBuilder
     Web Design
     Your HTML Source
     XML/XSLT Forums
     ASPAlliance
     Scripts
     
     Programmers Heaven
     Tek-Tips Forums
     Developer Fusion
     Code Project











METHOD:  Function::toSource


Function.toSource ()
 
The toSource method creates a string representing the source code of the function. This over-rides the Object.toSource method. Although the toSource method is usually called by JavaScript behind the scenes, you can call it yourself. This can be particularly useful when debugging. In the case of the built-in Function object, it returns a string indicating that the source code is not available, while, for a user-defined function, toSource will return the JavaScript source that defines it as a string. The following examples illustrate these uses:
 
Function.toSource()   returns:
function Function() { [native code] }
 
function Cat(breed, name, age)
{
   this.breed = breed
   this.name = name
   this.age = age
}
Cat.toSource()
   returns:
function Cat(breed, name, age) { this.breed = breed; this.name = name; this.age = age; }
 
Sheeba = new Cat("Manx", "Felix", 7)
Sheeba.toSource()
   returns:
{breed:"Manx", name:"Felix", age:7}

 


Copyright 1999-2005 by Infinite Software Solutions, Inc. All rights reserved.
Trademark Information