Paul, Thanks for the explanation on how frames work and how to get a reference to them. I was trying to reference to functions in my map frame directly; once I added to 'window.top' to my code I was able to get to the map frame.
In my JavaScript file I created a reference to the iframe and from there I was able to use Firefox/Firebug to figure out the objects/functions I needed to access the map commands. var map = window.top.frames.map; var fusion = map.Fusion(); ... Thanks again for you help. Jason -----Original Message----- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Paul Spencer Sent: Thursday, December 04, 2008 9:44 PM To: MapGuide Users Mail List Subject: Re: [mapguide-users] Using Fusion functions from a seperate iframe Each frame is a separate document, which means it has its own 'window' global variable. One of the members of window is parent which refers to the parent window of the current window. Normally this is a self- reference but if you are using frames then it refers to the parent frame or frameset. In your case, code running in map iframe can use window.parent to refer to the parent page. There is another property, top which refers to the ultimate parent directly in the case of nested frames. Window also has a frames member which can be used to reference the individual frames within the window. So ... from the code iframe, you should be able to do something like this: window.top.frames.map.someFunction(); which in this case is the same as: window.parent.frames.map.someFunction(); Note that the same origin policy applies to frames, restricting access to frames that are loaded from different domains. Cheers Paul On 4-Dec-08, at 8:50 AM, Jason Woodman wrote: > > I'm trying to access the fusion commands for a map from a javascript > function > in a separate iframe. Does anyone know how to do this and can > supply some > pointers or sample code on how to get a reference to the fusion > commands in > one iframe from another iframe. > > Here is my page setup > ------------------------------- > | parent page | > | --------------------------- | > | | map iframe | code iframe | | > | --------------------------- | > ------------------------------- > > My javascript function is in the code iframe, and I need to be able > to have > it access the map functions in the map iframe so I can do things > like select > objects, zoom to a selection, and the like. > > Thanks, > Jason Woodman > EMH&T, Inc. > -- > View this message in context: http://www.nabble.com/Using-Fusion-functions-from-a-seperate-iframe-tp20 833758p20833758.html > Sent from the MapGuide Users mailing list archive at Nabble.com. > > _______________________________________________ > mapguide-users mailing list > [email protected] > http://lists.osgeo.org/mailman/listinfo/mapguide-users _______________________________________________ mapguide-users mailing list [email protected] http://lists.osgeo.org/mailman/listinfo/mapguide-users CONFIDENTIALITY NOTICE: This e-mail message is intended only for the person or entity to which it is addressed and may contain confidential and/or privileged material. Any unauthorized review, use, disclosure or distribution is prohibited. If you are not the intended recipient, please contact the sender by reply e-mail and destroy all copies of the original message. If you are the intended recipient but do not wish to receive communications through this medium, please so advise the sender immediately. _______________________________________________ mapguide-users mailing list [email protected] http://lists.osgeo.org/mailman/listinfo/mapguide-users
