473,608 Members | 2,412 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Problem resizing a popup window (Permission Denied)

rizwan6feb
108 New Member
Hi experts! I getting the following error message from Firefox, for the given code

Error: uncaught exception: Permission denied to get property Window.resizeTo
Expand|Select|Wrap|Line Numbers
  1. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  2. <html xmlns="http://www.w3.org/1999/xhtml">
  3. <head>
  4. <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
  5. <title>Untitled Document</title>
  6. <script language="javascript">
  7.     var w;
  8.     var x=400; 
  9.     var y=80;
  10.     function showPopup(){
  11.         w=window.open('http://www.google.com',null,'width=400,height=80,scrollbars=0,menubar=0,toolbar=0,resizable=1');
  12.         resizeWindow();
  13.     }
  14.     function resizeWindow(){
  15.         w.resizeTo(x,y);
  16.         if(x>=700){
  17.             w.resizeTo(x,y);
  18.             y++;
  19.         }
  20.         else{
  21.             x++;
  22.         }
  23.         if(y<=300){
  24.             setTimeout("resizeWindow()",1);
  25.         }
  26.         else{
  27.             clearTimeout("resizeWindow()",1);
  28.         }
  29.     }
  30. </script>
  31. </head>
  32.  
  33. <body>
  34.     <input type="button" value="Show Popup" onclick="showPopup()" />
  35. </body>
  36. </html>
  37.  
May 22 '08 #1
4 3695
rnd me
427 Recognized Expert Contributor
you are not allowed (by a browser) to manipulate or even look at the window object of sites that don't match the main, address bar, current url.

you might be able to control the popup from the script using the w object, or by changing the window.open parameters.
May 22 '08 #2
rizwan6feb
108 New Member
you are not allowed (by a browser) to manipulate or even look at the window object of sites that don't match the main, address bar, current url.

you might be able to control the popup from the script using the w object, or by changing the window.open parameters.
I have been already using the w object to resize the popup window.
May 23 '08 #3
acoder
16,027 Recognized Expert Moderator MVP
As rnd me mentioned, you can't access the window if it's from another domain.

Either make sure the site is from your domain or load it from your domain.
May 23 '08 #4
gits
5,390 Recognized Expert Moderator Expert
I have been already using the w object to resize the popup window.
as it was said correctly here ... the problem is not the resize action, the problem is a cross-domain-scripting issue ... just let me put an additional link for the OP here - have a look here ...

kind regards
May 24 '08 #5

Sign in to post your reply or Sign up for a free account.

Similar topics

10
2311
by: riki | last post by:
Hi, i have a big problem...i'm using one jscript for resizing of all of my pics in popUp...in main html i'm having many little pics and clicking on them they open in popUp and resize to larger version of the same pic. now, it works fine and sometimes when i click on little one it doesn't resize well... this is the code: main.html
10
6726
by: David McCulloch | last post by:
The following code opens a new window, but the "resizeTo" doesn't resize it. Why not? (Don't ask why I simply did not open the window with the new size....my original problem was how to open a new window with maximized dimensions!) FYI, I uploaded the same code to: http://tosasoft.com/test/open.htm ========================================
3
2100
by: eft0 | last post by:
I have a big problem after I install SP2 in XP Box, some functions - window.resizeBy() - in my code, give a error like this: Access Denied. Some similar experience ?, any ideas what's happening here ?, Thanks in advanced. Esteban.
2
2209
by: maxrawson | last post by:
Greetings all: I have an asp.net application that is coded mainly in vb.net. I have successfully cut and pasted some javascript into my application that mimicks the datetime picker control in vb. I wanted to try to use that same code for another popup style window that displays a list of airport codes in a datagrid. The desired results would be that when an airport code (the datagrid's key field) is clicked the value would write back...
8
1359
by: Captain Dondo | last post by:
I am using a popup window to show pictures. Each time the user clicks on a thumbnail in the mail HTML page, the popup either appears or reloads a new picture. Some pictures are portrait, and some are landscape. I build the popup html dynamically. How can I a) resize the popup window to fit the image, and b) pop it to the forefront once the new picture is loaded? Thanks.
23
6396
by: Markus | last post by:
Hi, i have this problem: Sometimes, i can't reproduce, if i click on an small image on the website, the popup _AND_ an other Tab in firefox open. Here are the linkcode: <div align="center">
5
2224
by: Jean Pierre Daviau | last post by:
I have disable my firewall, virus software, google pop up allowed, ie6 popp up checker disabled. Is there an other one? This script tels me : "Pop-up windows are blocked. Please disable your popup blocker in order to use the site.".
8
2646
by: Grzegorz | last post by:
Hi! my problem: I open a pop-up window and try to refresh it contents every 30 seconds. the code below works in Firefox browser but in IE i get Permission Denied error. any suggestions how to make it work in IE? Regards, Grzegorz
2
2920
by: Venkatesh | last post by:
Hello all, We have a micro site that is getting opened inside a popup window from some external main site (the domains of our microsite and main site are different) ... I need to support the following functionality: After the user is done surfing the pages on our site and user clicks the close hyperlink (present on top of all of our webpages), the opener window's location needs to be reset to some given URL ....
0
8067
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8010
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8501
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8349
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
5479
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
3967
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4030
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2477
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
0
1336
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.