Loading ...
Sorry, an error occurred while loading the content.

Re: [OLmws] Re: Modal example with frames... (SOURCE CODE)

Expand Messages
  • Foteos Macrides
    Mark, Ahh... You ve jogged my memory about this kind of issue. The actual problem is that IE and the browsers using the AppleWebKit are still treating top
    Message 1 of 6 , Mar 16, 2009
    • 0 Attachment
      Mark,
       
      Ahh...  You've jogged my memory about this kind of issue.  The actual problem is that IE and the browsers using the AppleWebKit are still treating "top" as a reserved frame name (see
      i.e., should need a lead underscore to be treated as the reserved name in that context, and both Firefox and Opera do take the context into account, which is why what you had tried originally does work with those two browsers).
       
      If you change that frame name to "myTop" for example, then both the parent.myTop. and parent.frames["myTop"] references will work with all of the browsers.  But in your javascript string definition you would need backslash-escaped single-quotes (parent.frames[\'myTop\']) if you use the frames array.
       
      Fote
      --
       
      ----- Original Message -----
      From: Mark
      Sent: Monday, March 16, 2009 9:48 AM
      Subject: [OLmws] Re: Modal example with frames... (SOURCE CODE)

      Fote,

      That did it!  I tried using the frame name in quotes as in:

      parent.frames["top"].

      But that wouldn't work; the call, as you suggested, must have the frame number.

      I recently came across what you had stated about the difference between how IE handles frames vs. Opera and FF.  I had made the switch to use the "frames[?]" syntax, but learned that I was able to use the frame name ("top") instead of its number (0).  Hence, I figured I could do the same here.

      My guess is that I still likely could, but there's something causing the problem between quotes and double-quotes in the call.  For now, I will use the ordinal number; that should do me fine!

      Thanks so much for your help.



      --- In overlibmws@yahoogroups.com, "Foteos Macrides" <fote@...> wrote:
      >
      > Mark,
      >
      > The problem is that IE, Safari and Google Chrome have incomplete support for the use of frame names as references (they do work as the parameter for the overlibmws FRAME command, but not in an onclick attribute value), whereas Firefox and Opera support them in both contexts.  All of the browsers support frames[#] references in both contexts.  If you are not familiar with that nomenclature, see the examples in:
      >    http://www.macridesweb.com/oltest/CrossFrame/
      >
      > So to make your confirm dialog work across frames for all of those browsers, in your myConfirmDialogBox function use:
      >
      > . . .
      >  +'<input type="submit" '
      >  +'onclick="parent.frames[0].cClick();parent.frames[0].'+yes
      >  +';event.returnValue=false;return false;" value=" Yes ">  '
      >  +'<input type="submit" '
      >  +'onclick="parent.frames[0].cClick();parent.frames[0].'+no
      >  +';event.returnValue=false;return false;" value=" No ">'
      > . . .
      >
      > Fote
      > --
      >
      >   ----- Original Message -----
      >   From: Mark
      >   To: overlibmws@yahoogroups.com
      >   Sent: Thursday, March 12, 2009 9:08 PM
      >   Subject: [OLmws] Re: Modal example with frames... (SOURCE CODE)
      >
      >
      >   thanks for trying!  Interesting it works in all but IE; that's the most important to me.
      >
      >   Ok, I understand the business so if you get more time next week and come up with something, let me know.
      >
      >
      >
      >
      >   --- In overlibmws@yahoogroups.com, "Foteos Macrides" <fote@> wrote:
      >   >
      >   > Mark / Donna,
      >   >
      >   > I set up a frame pair as you described in:
      >   > http://tech.groups.yahoo.com/group/overlibmws/message/1364
      >   >
      >   > and did some quickie testing with the source code you describe (below), but with:
      >   >
      >   > . . .
      >   >  +'<input type="submit" '
      >   >  +'onclick="parent.top.cClick();'+parent.top.yes
      >   >  +';return false;" value=" Yes ">  '
      >   >  +'<input type="submit" '
      >   >  +'onclick="parent.top.cClick();'+parent.top.no
      >   >  +';return false;" value=" No ">'
      >   > . . .
      >   >
      >   > in the myConfirmDialogBox function.  That did work as intended with Firefox and Opera.  But it failed with IE (yielding the rather uninformative error message you had posted, and nothing better with IE's full debugging turned on), as well as with Safari (but no error message issued), and with Google Chrome (which like Safari is built on the AppleWebKit and so did not issue an error message, either).
      >   >
      >   > Unfortunately, I'm snowed under through the week-end, and doubt I'll be able to look at this problem more carefully until sometime next week.  If someone else solves it in the meantime, please do post the solution.
      >   >
      >   > Fote
      >   > --
      >   >
      >   >   ----- Original Message -----
      >   >   From: Mark
      >   >   To: overlibmws@yahoogroups.com
      >   >   Sent: Thursday, March 12, 2009 10:08 AM
      >   >   Subject: [OLmws] Modal example with frames... (SOURCE CODE)
      >   >
      >   >
      >   >   Thought providing my code might help...
      >   >
      >   >   includes:
      >   >
      >   >   <script type="text/javascript" src="http://localhost/js/overlibmws/overlibmws.js"></script>
      >   >   <script type="text/javascript" src="http://localhost/js/overlibmws/overlibmws_crossframe.js"></script>
      >   >   <script type="text/javascript" src="http://localhost/js/overlibmws/overlibmws_iframe.js"></script>
      >   >   <script type="text/javascript" src="http://localhost/js/overlibmws/overlibmws_modal.js"></script>
      >   >   <script type="text/javascript" src="http://localhost/js/overlibmws/overlibmws_shadow.js"></script>
      >   >
      >   >   Javascript code...
      >   >
      >   >   <SCRIPT LANGUAGE=JAVASCRIPT TYPE="TEXT/JAVASCRIPT">
      >   >   <!-- Hide script from old browsers
      >   >
      >   >   var myQ='Stay logged in ?', myCap='!!! ATTENTION !!!';
      >   >
      >   >   var timeoutId = startTimer();
      >   >   var confirmTimeoutId = null;
      >   >   //var stayLoggedIn = null;
      >   >
      >   >   function startTimer() {
      >   >   return setTimeout('confirmStillInUse();', 3000); // 600000 = 10 minutes
      >   >   }
      >   >
      >   >   function myConfirmDialogBox(q,yes,no,caption){
      >   >    q=(q||''); yes=(yes||''); no=(no||''); caption=(caption||'');
      >   >    var myConfirmDialog=q
      >   >    +(OLns4?'<form name="stayLoggedInForm" action="javascript:void(0);">':'')
      >   >    +'<div style="font-size:4px;;line-height:4px;">&nbsp;<br><\/div>'
      >   >    +'<input type="submit" '
      >   >    +'onclick="cClick();'+yes
      >   >    +';return false;" value=" Yes ">  '
      >   >    +'<input type="submit" '
      >   >    +'onclick="cClick();'+no
      >   >    +';return false;" value=" No ">'
      >   >    +(OLns4?'<\/form>':'');
      >   >   /*
      >   >    * Modify the styling appropriately for your site
      >   >    */
      >   >   overlib(myConfirmDialog,
      >   >    caption?CAPTION:DONOTHING, caption?caption:DONOTHING, CLOSETEXT,'',
      >   >    CAPTIONPADDING,4, TEXTPADDING,10, BGCLASS,'olbgD',
      >   >    CGCLASS,'olcgD', CAPTIONFONTCLASS,'olcapD', CLOSEFONTCLASS,'olcloD',
      >   >    FGCLASS,'olfgD', TEXTFONTCLASS,'oltxtD',
      >   >    SHADOW, SHADOWCOLOR,'#113377', SHADOWOPACITY,40, FRAME, parent.main,
      >   >    WRAP, STICKY, MODAL, MIDX,0, MIDY,0);
      >   >   }
      >   >
      >   >   function myYes(){
      >   >   stayLoggedIn();
      >   >   }
      >   >
      >   >   function myNo(){
      >   >   autoLogout();
      >   >   }
      >   >
      >   >   function confirmStillInUse() {
      >   >   clearTimeout(timeoutId);
      >   >
      >   >   confirmTimeoutId = setTimeout('autoLogout();', 10000);
      >   >
      >   >   myConfirmDialogBox(myQ,'myYes()','myNo()',myCap);
      >   >
      >   >   return false;
      >   >   }
      >   >
      >   >   function stayLoggedIn() {
      >   >   clearTimeout(confirmTimeoutId);
      >   >   timeoutId = startTimer();
      >   >   }
      >   >
      >   >   function autoLogout()
      >   >   {
      >   >   clearTimeout(timeoutId);
      >   >   clearTimeout(confirmTimeoutId);
      >   >
      >   >   .
      >   >   .
      >   >   .
      >   >   (continues)
      >   >   .
      >   >   .
      >   >   .
      >   >   }
      >   >
      >   >   function loadOption()
      >   >   {
      >   >   if (document.frmClientMenu.cmbMenu.value != '')
      >   >   {
      >   >   clearTimeout(timeoutId); // stop current timer
      >   >   timeoutId = startTimer(); // start new timer
      >   >
      >   >   parent.main.location = document.frmClientMenu.cmbMenu.value;
      >   >   }
      >   >   else
      >   >   alert("Please select an item from the menu.");
      >   >   }
      >   >   //-->
      >   >   </script>
      >   >
      >
    Your message has been successfully submitted and would be delivered to recipients shortly.