1. A computer-implemented method of generating interactive electronic documents, the method comprising: by a computer system comprising one or more hardware processors, generating a plurality of electronic documents, each of the electronic documents generated as an object having a non-variable first part, the non-variable first part comprising instructions configured to direct a processing unit to perform a function call in response to a user interaction, and a variable second part separate from the non-variable first part, the variable second part comprising variable data and functions defined to return the variable data in response to the function call, wherein the variable second part comprises either variable data enabling off-line processing of the document or access information to retrieve the respective data from a remote database requiring on-line processing of the document, wherein the instructions of the non-variable first part are in a first programming language and the instructions for the function call are in a second programming language, wherein the first language is a markup language and the second language is a language for a virtual machine, and the variable second part further comprising instructions for the function in the language for the virtual machine, wherein the second language is a scripting language.