Try our conversational search powered by Generative AI!

DOPE and document.domain

Vote:
 
We've been bugged by a really annoying "Access Denied" JavaScript error when we try to access the DOPE-menu on one of our sites. It turns out that it's because we set the "document.domain" to the top-level domain of the site to enable cross-subhost scripting; www.xxx.yyy -> xxx.yyy Naturally, the popup created with the "window.createPopup();" method does not inherit the current "document.domain" setting of the opener window, but gets set to the current hostname. Which means the created popup is not accessible after it's been created. Please advice if you're not allowed to make changes to the "contextmenu.js" file, but there is a workaround that looks like this; ContextMenu.prototype.CreatePopupWindow = function () { var orgDomain = document.domain; // Save current setting document.domain = location.hostname; // Set to hostname if(this.baseMenu && this.baseMenu.popupWindow!=null) this.popupWindow = this.baseMenu.popupWindow.document.parentWindow.createPopup(); else this.popupWindow = window.createPopup(); this.popupWindow.document.domain = orgDomain; // Set to wanted document.domain = orgDomain; // Reset ... } You get the point...
#16895
Dec 16, 2005 1:18
Vote:
 
Wrong forum and non-working workaround (the rightclick menu stop working in Edit-mode). Oh lucky day.
#17057
Dec 16, 2005 11:37
This thread is locked and should be used for reference only.
* You are NOT allowed to include any hyperlinks in the post because your account hasn't associated to your company. User profile should be updated.