473,399 Members | 2,146 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,399 software developers and data experts.

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.location.reload(true);
}
function funkcyjka () {
Mypopup = window.open('http://google.pl','okienko');
intervalHandler = setInterval("odswiez()",30000);

}
</script>

<body onload="funkcyjka()">
</body>
</html>

Mar 31 '06 #1
8 2638

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.location.reload(true);
}
function funkcyjka () {
Mypopup = window.open('http://google.pl','okienko');
intervalHandler = setInterval("odswiez()",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.location='http://google.pl'; //.reload(true);
else
clearInterval(intervalHandler);
}

--
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.location='http://google.pl'; //.reload(true);
Mypopup.location = Mypopup.location;
}

should also work.
else
clearInterval(intervalHandler);
}


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.location = Mypopup.location;

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.location = Mypopup.location;

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.location = Mypopup.location;

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.location = 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.javascript 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.location = Mypopup.location;

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.nihonsoft.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
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...
4
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...
7
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...
5
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...
0
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...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
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,...
0
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...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
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...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

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.