How can I use same instance of one particula .js across all .js functions
For eg: var test = new Test();
this test i need to use when ever I want to access Test() function(i.e same instance)
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
It depends a little on what exactly your code looks like, but:
should generally do the trick. After that, any scripts in your page should be able to see “test” as a global variable, which is the same as being a property of the
windowobject.