I'm new to JavaScript and confused about the scope of objects.
When you define an object in a script, can it be accessed from another script? Or do I need to define it as a document object?
In otherwords:
<script1>
var object1 = objectdefinition();
</script1>
<script2>
object1.method1();
</script2>
-or- do I need to preface the object with "document."
<script1>
var document.object1 = new objectdefinition();
</script1>
<script2>
document.object1.method1();
</script2>
mike
When you define an object in a script, can it be accessed from another script? Or do I need to define it as a document object?
In otherwords:
<script1>
var object1 = objectdefinition();
</script1>
<script2>
object1.method1();
</script2>
-or- do I need to preface the object with "document."
<script1>
var document.object1 = new objectdefinition();
</script1>
<script2>
document.object1.method1();
</script2>
mike