Hi,
I have a form that is being targetted to an iframe in another window. Right now I create a reference to that window when I open it and access various javascript methods through the reference like so:
[code=php]
//THE VIEWER PAGE.
var viewer = null;
function openViewer()
{ if(viewer==null || viewer.closed==true)
{ viewer = window.open(“multiviewer.html”,”mv”);
}
else
{ viewerLoaded();
}
}
function viewerLoaded()
{ var frameName = viewer.createTab();//createTab is a js method on viewer page that returns iframe name for targettting.
var servletForm = document.getElementById(“svForm”);
servletForm.target = frameName;
servletForm.submit();
}
This works fine but I am trying to expand this system so that any page submitting the form can check to see if ‘multiviewer.html’ is open and reference its scripting methods. The purpose is that I only want one of these files open at any one time, not one per opening page as it is now.
I have given the window the name “mv” but I am unsure how I can use this reference from other pages. Can anyone tell me if/how I can check from another window if the ‘multiviewer.html’ page is open somewhere already and if so, what is the syntax for referencing its javascript methods?
Any suggestions appreciated thanks!