3rd try

Another way, without changing the newAppletWindow() function in new.js 

The popup page cannot read variables from the opener page but can 
execute functins there (as proved by the call to jmolGetPropertyAsString() )
So:

  1. set a ***javascript function*** in the mother page that returns a value 
depending on your choice ("left" or "right" in your example). 

function whichJmolCalled() {
 var whichJmol = 'A';
 if (document.getElementById('optB').checked) { whichJmol = 'B'; } 
 return whichJmol;
}

which you should adapt to your case --how you specify which applet (this I 
did with two radio buttons A and B)

 2. modify the JmolPopup.htm source like
  
  function getState(){
  if (theScript) {
  return theScript
  }
  if (!opener) {
  alert("The page that opened this pop-up window is not available.")
  return ""
  }
 if (typeof opener.whichJmolCalled == "undefined") { var t = "0"; }
 else { var t = opener.whichJmolCalled(); }
 return opener.jmolGetPropertyAsString("stateInfo","", t) 
  }



------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
Jmol-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/jmol-users

Reply via email to