on 06-02-2005 9:30 AM
Hi Everyone
When creating an object using the following Javascript:
var oPopup = window.createPopup();
I try to set the innerHTML of this object using the following Javascript:
oPopup.document.body.innerHTML = oHistory.innerHTML;
But get an Access denied error when doing this. I know this is because the domain has been relaxed on the main BSP page but does anyone know how I can relax the domain on this new window before creating it?
I am trying to replicate the popup glossary example from the MSDN website:
<a href="http://msdn.microsoft.com/library/default.asp?url=/workshop/author/dhtml/reference/methods/createpopup.asp"> Popup Glossary Definitions
</a>
TIA
Faaiez
I know why this happens.
As a workaround, do not specify any BaseURL or Domain in your document. You will find your code works after removing those.
I believe future IE7 will fix this.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
If you control the complete application, consider to just remove all the domain relax stuff. Usually this comes from the portal integration flag.
Alternative, you must have a relaxed popup window (and programmer?) before starting to mess with this contents. The trick that we use is to load a relaxDomain.htm document into such a new window. Thereafter, it is relaxed, and we can pump in new HTML code.
Look at rendered HTMLB source to get the correct URL you want. Or see SYSTEM, frame buffered examples.
Is this enough to put you on the road again?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
For completeness:
I have managed to use a javascript PopupWindow.js to achieve this task. The javascript was downloaded from http://www.mattkruse.com/.
Faaiez
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I don't think it is a good idea to use this createPopup function, because it is ie5.5+ only.
Another way to do what you want is this :
<html>
<head>
<script type="text/javascript">
function popup(text)
{
var w = window.open ("about:blank",
"forum","menubar=1,resizable=1,width=675,height=650,scrollbars=yes");
w.document.write( text);
w.focus();
}
</script>
</head>
<body>
<a href="javascript:popup('this is a test');">Test</a>
</body>
</html>
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
The BSP will only be rolled out inhouse and all the users use IE6.0 so this is not a problem.
I know that one can open a different popup with window.open and window.showModalDialog. Both of these I have used successfully but I would like to develop a page that has the same effect as the 'Popup Glossary Definitions' example on the MSDN website.
User | Count |
---|---|
86 | |
10 | |
10 | |
9 | |
6 | |
6 | |
6 | |
5 | |
4 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.