G
George Hester
Please take a look at this google artcle:
http://groups.google.com/groups?hl=...5f9382&[email protected]#link9
The op was having trouble with access denied using resizeTo. I am having the same issue
but the explanations in this article don't seem to apply here. I am not trying to
resize a window with content from a different server. This issue lies here.
What I do is make a popup window in a manner that I was given here. I like it
better then what I had. Here it is:
<script language="javascript" type="text/javascript">
<!-- Begin
// Set the url of the banner popup window page
var theURL = '<%="/redir/default1.asp?pg=" & Server.URLEncode(strsnd1) & "&splt=" & splt1%>';
// Set the title of the popup window
var title = 'Warning';
// Set the size of the popup window
var windowWidth = 715; // cannot be less than 100
var windowHeight = 360; // cannot be less than 100
// Set the position of the popup window
var windowX = 35;
var windowY = 200;
// Set true to auto-center (positions will be ignored)
var autocenter = true;
// Set true for popup to close when launch page does
var autoclose = true;
var s = 'width='+windowWidth+',height='+windowHeight;
var beIE = ua.ie;
var done = new Object('no');
if (autocenter){
windowX = (window.screen.width-windowWidth)/2;
windowY = ((window.screen.height-windowHeight)/2)+50;
}
function doAgilePopup(){
if (beIE){
var frameString = [
'<html>',
'<head>',
'<title>'+title+'</title>',
'</head>',
'<frameset rows="*,0" framespacing="0" border="0" frameborder="0">',
'<frame name="top" src="'+theURL+'" scrolling="no" />',
'<frame name="bottom" src="about:blank" scrolling="no" />',
'</frameset>',
'</html>'
].join('\n');
window.newWindowHtml = frameString;
agilePopper = window.open('javascript
pener.newWindowHtml','popAgile','fullscreen=yes,'+s);
agilePopper.blur();
window.focus();
try{
if (typeof(agilePopper) == 'object'){
agilePopper.resizeTo(windowWidth,windowHeight);
agilePopper.moveTo(windowX,windowY);
}
}
catch(e){ alert('Cant\'t move window'); }
}
else{
agilePopper=window.open(theURL,'popAgile','scrollbars=no,'+s);
agilePopper.blur();
window.focus();
agilePopper.resizeTo(windowWidth,windowHeight);
agilePopper.moveTo(windowX,windowY);
}
agilePopper.focus();
if (autoclose)
window.onunload = function(){ agilePopper.close(); }
done = 'okay';
}
// End -->
</script>
You can see I try catch where the issue occurs. I know that it is accessed denied because that is what
the javascript exception says. Any way this does NOT occur all the time. If I access this page directly
then I get this error message. But if I access this page from links on my server I do NOT. Is that the
issue? The other host that I am accessing is called (none) and that is enough to throw this access
denied error? The trouble is the page appears fine and everthing works except the resizing and
moveto. And then they work when the page has a Referrer from my site. Thanks for any further
light on this issue and any suggestions how to work around this (besedes chucking it) would be greatly
appreciated.
http://groups.google.com/groups?hl=...5f9382&[email protected]#link9
The op was having trouble with access denied using resizeTo. I am having the same issue
but the explanations in this article don't seem to apply here. I am not trying to
resize a window with content from a different server. This issue lies here.
What I do is make a popup window in a manner that I was given here. I like it
better then what I had. Here it is:
<script language="javascript" type="text/javascript">
<!-- Begin
// Set the url of the banner popup window page
var theURL = '<%="/redir/default1.asp?pg=" & Server.URLEncode(strsnd1) & "&splt=" & splt1%>';
// Set the title of the popup window
var title = 'Warning';
// Set the size of the popup window
var windowWidth = 715; // cannot be less than 100
var windowHeight = 360; // cannot be less than 100
// Set the position of the popup window
var windowX = 35;
var windowY = 200;
// Set true to auto-center (positions will be ignored)
var autocenter = true;
// Set true for popup to close when launch page does
var autoclose = true;
var s = 'width='+windowWidth+',height='+windowHeight;
var beIE = ua.ie;
var done = new Object('no');
if (autocenter){
windowX = (window.screen.width-windowWidth)/2;
windowY = ((window.screen.height-windowHeight)/2)+50;
}
function doAgilePopup(){
if (beIE){
var frameString = [
'<html>',
'<head>',
'<title>'+title+'</title>',
'</head>',
'<frameset rows="*,0" framespacing="0" border="0" frameborder="0">',
'<frame name="top" src="'+theURL+'" scrolling="no" />',
'<frame name="bottom" src="about:blank" scrolling="no" />',
'</frameset>',
'</html>'
].join('\n');
window.newWindowHtml = frameString;
agilePopper = window.open('javascript
agilePopper.blur();
window.focus();
try{
if (typeof(agilePopper) == 'object'){
agilePopper.resizeTo(windowWidth,windowHeight);
agilePopper.moveTo(windowX,windowY);
}
}
catch(e){ alert('Cant\'t move window'); }
}
else{
agilePopper=window.open(theURL,'popAgile','scrollbars=no,'+s);
agilePopper.blur();
window.focus();
agilePopper.resizeTo(windowWidth,windowHeight);
agilePopper.moveTo(windowX,windowY);
}
agilePopper.focus();
if (autoclose)
window.onunload = function(){ agilePopper.close(); }
done = 'okay';
}
// End -->
</script>
You can see I try catch where the issue occurs. I know that it is accessed denied because that is what
the javascript exception says. Any way this does NOT occur all the time. If I access this page directly
then I get this error message. But if I access this page from links on my server I do NOT. Is that the
issue? The other host that I am accessing is called (none) and that is enough to throw this access
denied error? The trouble is the page appears fine and everthing works except the resizing and
moveto. And then they work when the page has a Referrer from my site. Thanks for any further
light on this issue and any suggestions how to work around this (besedes chucking it) would be greatly
appreciated.