468,135 Members | 1,402 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 468,135 developers. It's quick & easy.

reload

Hello, I would like to simplify the following script (in a single line)

parent.botFrame.location="mapage.html";
parent.botFrame.location.reload(true);

is it possible? Thank you
G.R

Jul 20 '05 #1
3 1808
Guy Roydor wrote:
Hello, I would like to simplify the following script (in a single line)

parent.botFrame.location="mapage.html";
parent.botFrame.location.reload(true);

is it possible? Thank you


Why would you want to try and simplify a program with 2 lines?

bengee

Jul 20 '05 #2
Guy Roydor wrote:
Hello, I would like to simplify the following script (in a single line)

parent.botFrame.location="mapage.html";
parent.botFrame.location.reload(true);


Line-optimized code is neither easily readable nor reliable.

Use a reference

if (parent.frames['botFrame'])
{
var f = parent.frames['botFrame'];
if (f.location && f.reload)
{
f.location = "mapage.html";
f.reload(true);
}
}

or the `with' statement:

if (parent.frames['botFrame'])
{
with (parent.frames['botFrame'])
{
if (location && reload)
{
location = "mapage.html";
reload(true);
}
}
}

I recommend to use the reference to avoid side effects.
HTH

PointedEars

Jul 20 '05 #3


bengee a écrit:
Guy Roydor wrote:
Hello, I would like to simplify the following script (in a single line)

parent.botFrame.location="mapage.html";
parent.botFrame.location.reload(true);

is it possible? Thank you

Why would you want to try and simplify a program with 2 lines?


because parent.botframe contents xxxxx.html ;
xxxxx.html is reload (and not mapage.html)
bengee


Jul 20 '05 #4

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

66 posts views Thread by Ellinghaus, Lance | last post: by
4 posts views Thread by David MacQuigg | last post: by
1 post views Thread by Emmanuel | last post: by
19 posts views Thread by Darren | last post: by
4 posts views Thread by Lonnie Princehouse | last post: by
3 posts views Thread by John Salerno | last post: by
8 posts views Thread by T. Wintershoven | last post: by
1 post views Thread by bernhard.voigt | last post: by
27 posts views Thread by didacticone | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.