473,543 Members | 1,925 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

popup refresh in IE problem

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
<html>
<script>
var Mypopup;
var intervalHandler ;
function odswiez() {
Mypopup.locatio n.reload(true);
}
function funkcyjka () {
Mypopup = window.open('ht tp://google.pl','oki enko');
intervalHandler = setInterval("od swiez()",30000) ;

}
</script>

<body onload="funkcyj ka()">
</body>
</html>

Mar 31 '06 #1
8 2643

Grzegorz wrote:
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
<html>
<script>
var Mypopup;
var intervalHandler ;
function odswiez() {
Mypopup.locatio n.reload(true);
}
function funkcyjka () {
Mypopup = window.open('ht tp://google.pl','oki enko');
intervalHandler = setInterval("od swiez()",30000) ;

}
</script>


You can't call a function on a diiferent domain, but you can change the
location of a window opened by your page.
Also, you must prevent further calls after the popup closes:

function odswiez()
{
if( !Mypopup.closed )
Mypopup.locatio n='http://google.pl'; //.reload(true);
else
clearInterval(i ntervalHandler) ;
}

--
S.C.

Apr 1 '06 #2
Stephen Chalmers wrote:
You can't call a function on a diiferent domain, but you can
change the location of a window opened by your page.
Also, you must prevent further calls after the popup closes:
Both statements are true.
function odswiez()
{
if( !Mypopup.closed )
if (Mypopup && !Mypopup.closed )
{
Mypopup.locatio n='http://google.pl'; //.reload(true);
Mypopup.locatio n = Mypopup.locatio n;
}

should also work.
else
clearInterval(i ntervalHandler) ;
}


However, assigning to .location is _not_ equivalent to .reload(true).
First, it can append to the window history; second, the resource will
be loaded from the local cache if feasible (therefore you need cache
control headers). reload(true) does neither.
PointedEars
Apr 1 '06 #3
Thanks for support. However I would like to force this popup to refresh
its current URL (user may navigate in it) - I do not want it to be hard
coded.

the solution with:

Mypopup.locatio n = Mypopup.locatio n;

does not working - I get exception error.

Maybe I should use vbscript ???

Regards,
Grzegorz

Apr 1 '06 #4
Grzegorz wrote:
Thanks for support. However I would like to force this popup to refresh
its current URL (user may navigate in it) - I do not want it to be hard
coded.
Since ...
the solution with:

Mypopup.locatio n = Mypopup.locatio n;

does not working - I get exception error.
.... you are out of luck with JS.
Maybe I should use vbscript ???


If it should be IE-only, you can try. But I doubt this will help.
PointedEars
Apr 1 '06 #5
Thomas 'PointedEars' Lahn said the following on 4/1/2006 7:44 AM:
Grzegorz wrote:
Thanks for support. However I would like to force this popup to refresh
its current URL (user may navigate in it) - I do not want it to be hard
coded.


Since ...
the solution with:

Mypopup.locatio n = Mypopup.locatio n;

does not working - I get exception error.


.... you are out of luck with JS.


No. You save a reference to the URL you opened in a Global scope and
then you set the location to that reference value:

var myURLVariable = "http://www.google.com" ;

function whatever(){
Mypopup.locatio n = myURLVariable;
}

Then, you aren't stuck with not being able to read the URL of a window
from a different domain (which is why the location = location doesn't work).

--
Randy
comp.lang.javas cript FAQ - http://jibbering.com/faq & newsgroup weekly
Javascript Best Practices - http://www.JavascriptToolbox.com/bestpractices/
Apr 1 '06 #6
Hi there,

I cannot read location property of this pop-up window - this is due to
cross-frame scripting security fix introduced in IE
(http://msdn.microsoft.com/library/de...g_security.asp)
Any ideas how to get it round?

Regards,
Grzegorz

Apr 2 '06 #7
Randy Webb wrote:
Thomas 'PointedEars' Lahn said the following on 4/1/2006 7:44 AM:
Grzegorz wrote:
Thanks for support. However I would like to force this popup to refresh
its current URL (user may navigate in it) - I do not want it to be hard ^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^ ^^^^^^^^^^^ coded.
^^^^^^ Since ...
the solution with:

Mypopup.locatio n = Mypopup.locatio n;

does not working - I get exception error.


.... you are out of luck with JS.


No. You save a reference to the URL you opened in a Global scope and
then you set the location to that reference value: [...]


You missed the point.
PointedEars
Apr 2 '06 #8
Grzegorz wrote:
I cannot read location property of this pop-up window - this is due to
cross-frame scripting security fix introduced in IE
This security feature is not only supported by IE, and certainly it is not
a "scripting security fix introduced in/by IE"; in fact, it originates from
Netscape 3.0 (JavaScript 1.1):

<URL:http://research.nihons oft.org/javascript/ns30/ref_d-e.htm#68458>
(http://msdn.microsoft.com/library/de...g_security.asp)

Any ideas how to get it round?


Well, you can lower IE's security level of course, but I strongly recommend
against that. You could try to add the site to the Trusted Sites list and
see what happens. Or maybe you have better luck with VBScript (viable only
in an IE-only environment), as you suggested.

You have not told enough about the environment this is supposed to run in.
Maybe if you did, that would allow for suggestions of alternative
approaches.
PointedEars
Apr 2 '06 #9

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

6
2021
by: Logger | last post by:
Help, Want someone's option. I'm calling a popup screen, say form B, to add/edit a record. In, say form A, I call form B using javascript window.open in server side code. I need to know when I come back to form A so I can refresh the screen from the database if a record was added or the data changed that I'm displaying. My question is: What...
4
3150
by: Andrew Alger | last post by:
ok i have two forms. Customer.aspx and Parent_Searh.aspx. There is a button on Customer.aspx that when executed runs javascript code to open up parent_search as a popup. After the user searches for the parent and finds the proper parent in the datagrid they then click on the accept button in the grid. Then I populate a session variable...
7
340
by: Logger | last post by:
Help, Want someone's option. I'm calling a popup screen, say form B, to add/edit a record. In, say form A, I call form B using javascript window.open in server side code. I need to know when I come back to form A so I can refresh the screen from the database if a record was added or the data changed that I'm displaying. My question is: What...
5
518
by: Andrew Alger | last post by:
ok i have two forms. Customer.aspx and Parent_Searh.aspx. There is a button on Customer.aspx that when executed runs javascript code to open up parent_search as a popup. After the user searches for the parent and finds the proper parent in the datagrid they then click on the accept button in the grid. Then I populate a session variable...
0
1249
by: NewJavaBee | last post by:
please guide me. i have the following problem: i have a parent window that has a dropdown that is showing names and which is getting its value from a table.table conatins two columns, one is Name and other is Release. there is a button called AddNew which is used to add new Name and release in table. on clicking the button a popup window...
0
7411
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...
0
7354
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...
1
7354
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
0
7693
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...
0
4898
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...
0
3394
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...
0
3394
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
1824
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
1
978
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.