WebFX WebBoard
Message Thread:
View All Messages
Back to WebFX
 DHTML Menu 4 menu.invalidate() cause permision denied error on submenus in Windows XP SP2 RC1, marcus Kellermann, May 7, 2004
     Re:DHTML Menu 4 menu.invalidate() cause permision denied error on submenus in Windows XP SP2 RC1, Erik Arvidsson, May 9, 2004
         Re:DHTML Menu 4 menu.invalidate() cause permision denied error on submenus in Windows XP SP2 RC1, marcus Kellermann, May 10, 2004

Subject: DHTML Menu 4 menu.invalidate() cause permision denied error on submenus in Windows XP SP2 RC1 From: marcus Kellermann Date: May 7, 2004

I have a problem that is related to the new changes in IE for Windows XP SP2.

If you have a Menu with a submenu. If submenu item script calls menu.invalidate() then when you attempt to navigate to the submenu again you will get a permission denied error from IE.

If you use MenuBar.invalidate() the error doesn't happen but any changes that you did to the menus don't show up.  I.e. if you disabled a menu item or something.

I was able to reproduce this with a simple modifcation of framedemo.html

Add a script called test(){ fileMenu.invalidate();} wire test up as the action of the open sub menu item.,

Click on File.. then Open, now go back and click on File again, and error is displayed when you go to open the submenu item.

XP Service Pack 2 Preview can be downloaded from http://www.microsoft.com/technet/prodtechnol/winxppro/sp2preview.mspx

Thanks

  Marcus Kellermann

 

<code>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
 "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">

<html>
<head>
<title>IE Menu Strucure Demo (WebFX)</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<!-- using doc write to read query string
<link type="text/css" rel="StyleSheet" href="skins/officexp/officexp.css" />
-->
<script type="text/javascript">

var ie55 = /MSIE ((5\.[56789])|([6789]))/.test( navigator.userAgent ) &&
   navigator.platform == "Win32";

if ( !ie55 ) {
 window.onerror = function () {
  return true;
 };
}

function writeNotSupported() {
 if ( !ie55 ) {
  document.write( "<p class=\"warning\">" +
   "This script only works in Internet Explorer 5.5" +
   " or greater for Windows</p>" );
 }
}

</script>
<script type="text/javascript">

function getQueryString( sProp ) {
 var re = new RegExp( sProp + "=([^\\&]*)", "i" );
 var a = re.exec( document.location.search );
 if ( a == null )
  return "";
 return a[1];
};

function changeCssFile( sCssFile ) {
 var loc = String(document.location);
 var search = document.location.search;
 if ( search != "" )
  loc = loc.replace( search, "" );
 loc = loc + "?css=" + sCssFile;
 document.location.replace( loc );
}

var cssFile = getQueryString( "css" );
if ( cssFile == "" )
 //cssFile = "skins/winclassic.css";
 cssFile = "skins/winclassic.css";

document.write("<link type=\"text/css\" rel=\"StyleSheet\" href=\"" + cssFile + "\" />" );

</script>
<style type="text/css">

body {
 background: ThreeDFace;
 border:  0;
 margin:  0;
 overflow: hidden;
}

html {
 border: 0;
 overflow: hidden;
}

</style>
<script type="text/javascript" src="js/poslib.js"></script>
<script type="text/javascript" src="js/scrollbutton.js"></script>
<script type="text/javascript" src="js/menu4.js"></script>
</head>
<body>

<script type="text/javascript">
function test()
{
    //document.getElementById("main").src="http://www.msn.com";
    fileMenu.invalidate();
}
//<![CDATA[

Menu.prototype.cssFile = cssFile;
Menu.prototype.mouseHoverDisabled = false;

var tmp;
var mb = new MenuBar;

///////////////////////////////////////////////////////////////////////////////
// File Menu
//

 var fileMenu = new Menu();

  var fileNewMenu = new Menu();
  fileNewMenu.add( tmp = new MenuItem( "Window", test) );
  tmp.mnemonic = "w";
  tmp.shortcut = "Ctrl+N";
  fileNewMenu.add( new MenuSeparator() );
  fileNewMenu.add( tmp = new MenuItem( "Message" ) );
  tmp.mnemonic = "m";
  fileNewMenu.add( tmp = new MenuItem( "Post" ) );
  tmp.mnemonic = "p";
  fileNewMenu.add( tmp = new MenuItem( "Contact" ) );
  tmp.mnemonic = "c";
  fileNewMenu.add( tmp = new MenuItem( "Internet Call" ) );
  tmp.mnemonic = "i";

 fileMenu.add( tmp = new MenuItem( "New", null, null, fileNewMenu ) );
 tmp.mnemonic = "n";
 fileMenu.add( tmp = new MenuItem( "Open..",test) );
 tmp.mnemonic = "o";
 tmp.shortcut = "Ctrl+O";
 fileMenu.add( tmp = new MenuItem( "Save" ) );
 tmp.mnemonic = "s";
 tmp.shortcut = "Ctrl+S";
 tmp.disabled = true;
 fileMenu.add( tmp = new MenuItem( "Save As..." ) );
 tmp.mnemonic = "a";
 tmp.shortcut = "Ctrl+S";
 fileMenu.add( new MenuSeparator() );
 fileMenu.add( tmp = new MenuItem( "Page Setup..." ) );
 tmp.mnemonic = "u";
 fileMenu.add( tmp = new MenuItem( "Print..." ) );
 tmp.mnemonic = "p";
 tmp.shortcut = "Ctrl+P";
 fileMenu.add( tmp = new MenuItem( "Print Preview..." ) );
 tmp.mnemonic = "v";
 fileMenu.add( new MenuSeparator() );

  var fileSendMenu = new Menu();
  fileSendMenu.add( tmp = new MenuItem( "Page by E-mail..." ) );
  tmp.mnemonic = "p";
  fileSendMenu.add( tmp = new MenuItem( "Link by E-mail..." ) );
  tmp.mnemonic = "l";
  fileSendMenu.add( tmp = new MenuItem( "Shortcut to Desktop" ) );
  tmp.mnemonic = "s";
 
 fileMenu.add( tmp = new MenuItem( "Send", null, null, fileSendMenu ) );
 tmp.mnemonic = "e";
 fileMenu.add( tmp = new MenuItem( "Import and Export" ) );
 tmp.mnemonic = "i";
 fileMenu.add( new MenuSeparator() );
 fileMenu.add( tmp = new MenuItem( "Properties" ) );
 tmp.mnemonic = "r";
 fileMenu.add( tmp = new MenuItem( "Close" ) );
 tmp.mnemonic = "c";

mb.add( tmp = new MenuButton( "File", fileMenu ) );
tmp.mnemonic = "f";

 var editMenu = new Menu();
 
 editMenu.add( tmp = new MenuItem( "Cut" ) );
 tmp.mnemonic = "t";
 tmp.shortcut = "Ctrl+X";
 editMenu.add( tmp = new MenuItem( "Copy" ) );
 tmp.mnemonic = "c";
 tmp.shortcut = "Ctrl+C";
 editMenu.add( tmp = new MenuItem( "Paste" ) );
 tmp.mnemonic = "p";
 tmp.shortcut = "Ctrl+V";
 editMenu.add( new MenuSeparator() );
 editMenu.add( tmp = new MenuItem( "Select All" ) );
 tmp.mnemonic = "a";
 tmp.shortcut = "Ctrl+A";
 editMenu.add( new MenuSeparator() );
 editMenu.add( tmp = new MenuItem( "Find (on This Page)..." ) );
 tmp.mnemonic = "f";
 tmp.shortcut = "Ctrl+F";
 
mb.add( tmp = new MenuButton( "Edit", editMenu ) );
tmp.mnemonic = "e";

///////////////////////////////////////////////////////////////////////////////
// View Menu
//
 var viewMenu = new Menu();
 
  var viewToolbarsMenu = new Menu();
  viewToolbarsMenu.add( tmp = new CheckBoxMenuItem( "Standard Buttons", true ) );
  tmp.mnemonic = "s";
  viewToolbarsMenu.add( tmp = new CheckBoxMenuItem( "Address Bar", true ) );
  tmp.mnemonic = "a";
  viewToolbarsMenu.add( tmp = new CheckBoxMenuItem( "Links", true ) );
  tmp.mnemonic = "l";
  viewToolbarsMenu.add( new MenuSeparator() );
  viewToolbarsMenu.add( tmp = new CheckBoxMenuItem( "Lock the Toolbars", false ) );
  tmp.mnemonic = "b";
  viewToolbarsMenu.add( tmp = new MenuItem( "Customize..." ) );
  tmp.mnemonic = "c";
  
 viewMenu.add( tmp = new MenuItem( "Toolbars", null, null, viewToolbarsMenu ) );
 tmp.mnemonic = "t";
 viewMenu.add( tmp = new CheckBoxMenuItem( "Statusbar", true ) );
 tmp.mnemonic = "b";
 
  var viewExplorerBarMenu = new Menu();
  viewExplorerBarMenu.add( tmp = new RadioButtonMenuItem( "Search", false, "explorerBarGroup" ) );
  tmp.mnemonic = "s";
  tmp.shortcut = "Ctrl+E";
  viewExplorerBarMenu.add( tmp = new RadioButtonMenuItem( "Favorites", false, "explorerBarGroup" ) );
  tmp.mnemonic = "f";
  tmp.shortcut = "Ctrl+I";
  viewExplorerBarMenu.add( tmp = new RadioButtonMenuItem( "Media", false, "explorerBarGroup" ) );
  tmp.mnemonic = "m";
  viewExplorerBarMenu.add( tmp = new RadioButtonMenuItem( "History", false, "explorerBarGroup" ) );
  tmp.mnemonic = "o";
  tmp.shortcut = "Ctrl+H";
  viewExplorerBarMenu.add( tmp = new RadioButtonMenuItem( "Folders", false, "explorerBarGroup" ) );
  tmp.mnemonic = "t";
  viewExplorerBarMenu.add( new MenuSeparator() );
  viewExplorerBarMenu.add( tmp = new CheckBoxMenuItem( "Tip of The Day", false ) );
  tmp.mnemonic = "f";

 viewMenu.add( tmp = new MenuItem( "Explorer Bar", null, null, viewExplorerBarMenu ) );
 tmp.mnemonic = "e";
 viewMenu.add( new MenuSeparator() );
 
  var viewGoToMenu = new Menu();
  viewGoToMenu.add( tmp = new MenuItem( "Back" ) );
  tmp.mnemonic = "b";
  tmp.shortcut = "Alt+Left Arrow"
  viewGoToMenu.add( tmp = new MenuItem( "Forward" ) );
  tmp.mnemonic = "f";
  tmp.shortcut = "Alt+Right Arrow"
  tmp.disabled = true;
  viewGoToMenu.add( new MenuSeparator() );
  viewGoToMenu.add( tmp = new MenuItem( "Home" ) );
  tmp.mnemonic = "";
  tmp.shortcut = "Alt+Home"
  viewGoToMenu.add( new MenuSeparator() );
  viewGoToMenu.add( tmp = new RadioButtonMenuItem( "Google", false, "goToGroup" ) );
  viewGoToMenu.add( tmp = new RadioButtonMenuItem( "WebFX - What you never thought possible", true, "goToGroup" ) );
  
 viewMenu.add( tmp = new MenuItem( "Go To", null, null, viewGoToMenu ) );
 tmp.mnemonic = "o";
 viewMenu.add( tmp = new MenuItem( "Stop" ) );
 tmp.mnemonic = "p";
 tmp.shortcut = "Esc";
 viewMenu.add( tmp = new MenuItem( "Refresh" ) );
 tmp.mnemonic = "r";
 tmp.shortcut = "F5";
 viewMenu.add( new MenuSeparator() );
  
  var viewTextSizeMenu = new Menu();
  viewTextSizeMenu.add( tmp = new RadioButtonMenuItem( "Largest", false, "textSizeGroup" ) );
  tmp.mnemonic = "g";
  viewTextSizeMenu.add( tmp = new RadioButtonMenuItem( "Larger", false, "textSizeGroup" ) );
  tmp.mnemonic = "l";
  viewTextSizeMenu.add( tmp = new RadioButtonMenuItem( "Medium", true, "textSizeGroup" ) );
  tmp.mnemonic = "m";
  viewTextSizeMenu.add( tmp = new RadioButtonMenuItem( "Smaller", false, "textSizeGroup" ) );
  tmp.mnemonic = "s";
  viewTextSizeMenu.add( tmp = new RadioButtonMenuItem( "Smallest", false, "textSizeGroup" ) );
  tmp.mnemonic = "a";
 
 viewMenu.add( tmp = new MenuItem( "Text Size", null, null, viewTextSizeMenu ) );
 tmp.mnemonic = "x";
 
  var viewEncodingMenu = new Menu();
  viewEncodingMenu.add( new MenuItem( "Auto-Select" ) );
  viewEncodingMenu.add( new MenuSeparator() );
  viewEncodingMenu.add( tmp = new MenuItem( "More" ) );
  tmp.mnemonic = "m";
 
 viewMenu.add( tmp = new MenuItem( "Encoding", null, null, viewEncodingMenu ) );
 tmp.mnemonic = "d";
 viewMenu.add( new MenuSeparator() );
 viewMenu.add( tmp = new MenuItem( "Source" ) );
 tmp.mnemonic = "c";
 viewMenu.add( tmp = new MenuItem( "Privacy Report..." ) );
 tmp.mnemonic = "p";
 viewMenu.add( tmp = new MenuItem( "Full Screen" ) );
 tmp.mnemonic = "f";
 tmp.shortcut = "F11";
 
mb.add( tmp = new MenuButton( "View", viewMenu ) );
tmp.mnemonic = "v";

///////////////////////////////////////////////////////////////////////////////
// Favorites Menu
//

 var favoritesMenu = new Menu();
 favoritesMenu.add( tmp = new MenuItem( "Add to Favorites..." ) );
 tmp.mnemonic = "a";
 favoritesMenu.add( tmp = new MenuItem( "Organize Favorites..." ) );
 tmp.mnemonic = "o";
 favoritesMenu.add( new MenuSeparator() );
 
  var linksMenu = new Menu();
  linksMenu.add( tmp = new MenuItem( "(Empty)" ) );
  tmp.disabled = true;
 
 favoritesMenu.add( tmp = new MenuItem( "Links", null, "images/folder.small.png", linksMenu ) );
 

mb.add( tmp = new MenuButton( "Favorites", favoritesMenu ) );
tmp.mnemonic = "a";

///////////////////////////////////////////////////////////////////////////////
// Tools Menu
//

 var toolsMenu = new Menu();
 
  var toolsMailAndNewsMenu = new Menu();
  toolsMailAndNewsMenu.add( tmp = new MenuItem( "Read Mail" ) );
  tmp.mnemonic = "m";
  toolsMailAndNewsMenu.add( tmp = new MenuItem( "New Message..." ) );
  tmp.mnemonic = "w";
  toolsMailAndNewsMenu.add( tmp = new MenuItem( "Send Link..." ) );
  tmp.mnemonic = "l";
  toolsMailAndNewsMenu.add( tmp = new MenuItem( "Send Page..." ) );
  tmp.mnemonic = "p";
  toolsMailAndNewsMenu.add( new MenuSeparator() );
  toolsMailAndNewsMenu.add( tmp = new MenuItem( "Read News" ) );
  tmp.mnemonic = "n";
 
 toolsMenu.add( tmp = new MenuItem( "Mail and News", null, null, toolsMailAndNewsMenu ) );
 tmp.mnemonic = "m";
 
 toolsMenu.add( tmp = new MenuItem( "Synchronize..." ) );
 tmp.mnemonic = "s";
 toolsMenu.add( tmp = new MenuItem( "Windows Update" ) );
 tmp.mnemonic = "u";
 toolsMenu.add( new MenuSeparator() );
 toolsMenu.add( tmp = new MenuItem( "Messenger" ) );
 toolsMenu.add( tmp = new MenuItem( "Show Related Links" ) );
 tmp.mnemonic = "r";
 toolsMenu.add( new MenuSeparator() );
 toolsMenu.add( tmp = new MenuItem( "Internet Options..." ) );
 tmp.mnemonic = "o";

mb.add( tmp = new MenuButton( "Tools", toolsMenu ) );
tmp.mnemonic = "t";

///////////////////////////////////////////////////////////////////////////////
// Help Menu
//

 var helpMenu = new Menu();
 helpMenu.add( tmp = new MenuItem( "Contents and Index" ) );
 tmp.mnemonic = "c";
 helpMenu.add( tmp = new MenuItem( "Tip of The Day" ) );
 tmp.mnemonic = "d";
 helpMenu.add( tmp = new MenuItem( "For Netscape Users" ) );
 tmp.mnemonic = "n";
 helpMenu.add( tmp = new MenuItem( "Online Support" ) );
 tmp.mnemonic = "s";
 helpMenu.add( tmp = new MenuItem( "Send Feedback" ) );
 tmp.mnemonic = "k";
 helpMenu.add( new MenuSeparator() );
 helpMenu.add( tmp = new MenuItem( "About Internet Explorer" ) );
 tmp.mnemonic = "a";

mb.add( tmp = new MenuButton( "Help", helpMenu ) );
tmp.mnemonic = "h";

mb.write();
//document.body.appendChild( mb.create() );

//]]>
</script>
<script type="text/javascript">
writeNotSupported();
</script>

<iframe id="main" src="http://webfx.eae.net" style="width: 100%; border: 0;"></iframe>

<script type="text/javascript">

function fixSize() {
 var m = document.getElementById("main");
 m.style.height = Math.max(0,
   posLib.getCanvasElement(document.body).clientHeight -
   m.offsetTop) + "px";
}

fixSize();
window.onresize = fixSize;

</script>

</body>
</html>

</code>




Reply
Name: 
Email: 
Subject: 

Enter your reply to this message below. HTML tags are not supported but words that start with http://, ftp:// or mailto: are converted to links.


View All Messages
Back to WebFX