Guest Bat007 Posted June 28, 2006 Share Posted June 28, 2006 I create a method in 1_a.htm, using an object instanced in 1_b.htm. How could I call it from 1_a with the active instance ?Thanks"1_a.htm"<script langage="javascript"> function setScene() { document.seemobject; //is NULL why ? }"1_b.htm"<html><body bgcolor="MediumSpringGreen"> <object id="seemobject" height="100%" width="100%" ... <param ...> </object></body></html>Need some help please Link to comment Share on other sites More sharing options...
aleksanteri Posted June 28, 2006 Share Posted June 28, 2006 You need to access "seemobject" with document.getElementById("seemobject") The document.seemobject works only if seemobject is in the name attribute of the object. Link to comment Share on other sites More sharing options...
justsomeguy Posted June 28, 2006 Share Posted June 28, 2006 It's null because it's not a part of the document. You can't refer to another document's elements. Notice that you use the document object to refer to everything, and the document object only applies to the current document, you can't just reference some arbitrary element on another page. It would take the DOM forever to load and traverse. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now