473,411 Members | 1,895 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,411 software developers and data experts.

window.location -- in a blank window....

I'm trying to open a url in a new window while pg loads (but NOT in a
pop-up..) I need to do sthg like

// while pg is loading..

window.location ='page.html'
// but I need this to open in a new blank window..
// (NOT in a pop-up, a regular new window..)

can you do this?? thank you..

Frances Del Rio

Jul 23 '05 #1
14 37120
Frances Del Rio wrote:
I'm trying to open a url in a new window while pg loads (but NOT in a
pop-up..)


That is a contradiction in terms. Opening a URI in a new window IS a popup.

--
David Dorward <http://blog.dorward.me.uk/> <http://dorward.me.uk/>
Home is where the ~/.bashrc is
Jul 23 '05 #2
Frances Del Rio wrote:
I'm trying to open a url in a new window while pg loads (but NOT in a
pop-up..) I need to do sthg like

// while pg is loading..

window.location ='page.html'
// but I need this to open in a new blank window..
// (NOT in a pop-up, a regular new window..)

can you do this?? thank you..

Frances Del Rio


The only difference between a "popup" and a "new windows" is the name. A
popup is a new window, a new window is a popup.

If you want a new window using JavaScript, just use:

window.open('page.html', 'windowName');

By not specifying a third parameter, you should get a new window with the
default size, position and chrome.

--
Grant Wagner <gw*****@agricoreunited.com>
comp.lang.javascript FAQ - http://jibbering.com/faq
Jul 23 '05 #3
The only difference between a "popup" and a "new windows" is the name. A
popup is a new window, a new window is a popup.


Excuse me?? there is quite a difference between the two, it seems to me..
a new blank window (opened with a regular <a href="#" target="_blank">)
tag will not be blocked by pop-up blockers... a pop-up window opened
with the window.open() method will.. (apart from other differences,
like for example in a pop-up you can customize how much chrome you
include, in a new blank window you can't.. the way you resize them (you
can resize a new blank window, but it's done differently from how you do
it in a pop-up, where you do it in args in window.open() method..)

at work we use pop-ups for legitimate reasons, not for advertising...
but we've started to come up against pop-up blockers.. I thought we
could open new blank windows instead, which is very simple, except if
you're trying to do window.location upon loading and need this location
to open in a new blank window instead of in same window (the way you
would do in <a href="#" target="_blank"> thank you all for your
response.. still am hoping to find a solution to this problem.. Frances

Jul 23 '05 #4
Frances Del Rio <fd***@yahoo.com> writes:
Excuse me?? there is quite a difference between the two, it seems to me..
a new blank window (opened with a regular <a href="#"
target="_blank">) tag will not be blocked by pop-up blockers... a
pop-up window opened with the window.open() method will..
That dependes on the popup blocker. Some block any new window, no
matter how it was created. Some won't block all script-derived new
windows. Some block windows depending on whether they come from
a user interaction or not.
at work we use pop-ups for legitimate reasons, not for
advertising... but we've started to come up against pop-up blockers..
Fighting against popup-blockers is a losing battle. (That makes it
winning, for us on the other side :)
I thought we could open new blank windows instead, which is very
simple,
So, this should create a "non-popup" popup:

<a href="somelink.html" target="winname" id="foo"></a>
<script type="text/javascript">
document.links['foo'].click();
</script>

My bet at least some popup-blocker will block that too ...

and testing ...

Yes, blocked in Mozilla FireFox. Not blocked in Opera (damn!). No
blocker in IE yet.
except if you're trying to do window.location upon loading and
need this location to open in a new blank window instead of in same
window


Hmm, I don't think I understand what you are trying to do.

/L
--
Lasse Reichstein Nielsen - lr*@hotpop.com
DHTML Death Colors: <URL:http://www.infimum.dk/HTML/rasterTriangleDOM.html>
'Faith without judgement merely degrades the spirit divine.'
Jul 23 '05 #5
In article <2m************@uni-berlin.de>, fd***@yahoo.com enlightened
us with...
The only difference between a "popup" and a "new windows" is the name. A
popup is a new window, a new window is a popup.


Excuse me?? there is quite a difference between the two, it seems to me..
a new blank window (opened with a regular <a href="#" target="_blank">)


That's HTML, not javascript.
And its use is discouraged on the internet. The internet is accessible
by many user agents, not just MSIE browser. ;)
Actually, if you used a strict doctype, you wouldn't be able to use the
target anyway. (You ARE using a doctype, right?)

A popup is any window opened by script, be it javascript or vbscript or
Flash. Unrequested popups are the ones people block most often. That
means they opened without the user clicking on anything or initiating
some event.
A "new window" doesn't even exist in some user agents.

As to blockers, MOST won't block a new window opened as a direct result
of a user click, mouse action, or keypress. Perhaps your functions need
a re-write. You should not be opening unrequested windows. The function
that is fired when the user clicks has to be the one with the open in
it. I've had the most luck doing that, but my main browsers of concern
are Mozilla/Netscape/Firefox/Opera with the option to disallow
unrequested popups. I have not tested that in all the blockers available
for MSIE. Some of them block ALL calls to window.open.

Note that giving something a target in HTML doesn't guarantee it will
open in a new window. I can change that with my browser (mozilla) and
open it in a tab or set it to open in the current window and ignore your
target.

The only way to open a window in javascript is with window.open. There
is no magic other way that won't be blocked.

I have yet to see something that uses popups that truly requires them.

--
--
~kaeli~
A hangover is the wrath of grapes.
http://www.ipwebdesign.net/wildAtHeart
http://www.ipwebdesign.net/kaelisSpace

Jul 23 '05 #6


Frances Del Rio wrote:
The only difference between a "popup" and a "new windows" is the name. A
popup is a new window, a new window is a popup.
Excuse me?? there is quite a difference between the two, it seems to me..
a new blank window (opened with a regular <a href="#" target="_blank">)
tag will not be blocked by pop-up blockers... a pop-up window opened
with the window.open() method will..


No, there is no difference between a new window and a popup.

There is a difference between a window opened by the browser as a result of
specifying a TARGET attribute on an <A> tag and a window opened
programmatically using client-side JavaScript.

There is even a difference between programmatically opened windows that were
opened as the result of some user action (such as clicking a link) and
programmatically opened windows which opened as the result of event beyond the
user's control (such as the page loading). In some cases a "popup blocker"
will block the latter, but not the former, in other cases, a "popup blocker"
considers them both unacceptable.

As for myself, my "popup blocking mechanism" even considers <a href="..."
target="_blank"> unacceptable and refuses to open such links in a new window
unless I specifically allow it.
at work we use pop-ups for legitimate reasons, not for advertising...
but we've started to come up against pop-up blockers.. I thought we
could open new blank windows instead, which is very simple, except if
you're trying to do window.location upon loading and need this location
to open in a new blank window instead of in same window (the way you
would do in <a href="#" target="_blank"> thank you all for your
response.. still am hoping to find a solution to this problem.. Frances


As has already been discussed, there is no solution. Stop using
programmatically opened windows. Or stop using code that opens new windows
without the user explicitly requesting one (which will get you past some, but
not all "popup blockers"). Ultimately you will have to abandon any attempt to
control your users' desktops, so you may as well start now instead of trying
to find a bubblegum and paperclip solution to the problem.

--
Grant Wagner <gw*****@agricoreunited.com>
comp.lang.javascript FAQ - http://jibbering.com/faq
Jul 23 '05 #7
Frances Del Rio wrote:
The only difference between a "popup" and a "new windows" is
the name. A popup is a new window, a new window is a popup.


Excuse me?? there is quite a difference between the two, it seems
to me.. a new blank window (opened with a regular <a href="#"
target="_blank">) tag will not be blocked by pop-up blockers...
a pop-up window opened with the window.open() method will..

<snip>

The last resort of those that will not abandon the practice of
attempting to open new windows is to appeal to the notion of the
"requested" pop-up. Unfortunately different pop-up blocking mechanisms
have different notions of what is to be considered "requested" and some
make no distinction at all:-

<URL: http://www.litotes.demon.co.uk/js_info/pop_ups.html >

Richard.
Jul 23 '05 #8

ok, I thank everyone for their comments/feedback... but I'd like to say
that where I work, we're an internet co. that mainly produces webcasts
for Fortune 500 cos., trade associations, some non-profits... we use
pop-ups for the video displays, we open a window that's approx 790x530,
on the left side is the video, on the right images that flip (or are
flipped by user) as video progresses.. this is a perfectly legitimate
use of pop-up windows.. there's no way we can do this in same window
where users register, login, etc (that has a nav frame on the left and
on main frame pgs for registration, login, etc..) if you go to
www.foxnews.com and scroll down to where it says "News 24/7" and click
on a video link you will see what I mean.. our media viewer windows are
more or less the same size, and have a similar layout (ours look better,
though.. ;) and of course they have no advertising..)

so: yes, it IS a drag that advertisers are abusing this function,
because I personally find pop-ups really neat, I think you can design
good UI w/them if you use them right.. I have been doing HTML for about
10 years now, and have used them a lot in my personal website also
(www.francesdelrio.com) (& practically all of them are opened by user..)

and the thing is, going back to my situation at work, if a user goes to
main page and our sw detects this user is already registered and we have
their password stored or whatever this video viewer pops up
automatically, w/out any input from user, while pg is still loading in
many cases.. this is where the problem arises.. so I came up w/idea
that instead of a pop-up opened w/window.open() method we could open the
video viewer in a regular new blank window, <a href="__"
target="_blank"> and resize... but how do you do this while page is
loading (w/o input from user??)

ok, I think I've written enough for now... ;)

Frances

kaeli wrote:
In article <2m************@uni-berlin.de>, fd***@yahoo.com enlightened
us with...
The only difference between a "popup" and a "new windows" is the name. A
popup is a new window, a new window is a popup.


Excuse me?? there is quite a difference between the two, it seems to me..
a new blank window (opened with a regular <a href="#" target="_blank">)

That's HTML, not javascript.
And its use is discouraged on the internet. The internet is accessible
by many user agents, not just MSIE browser. ;)
Actually, if you used a strict doctype, you wouldn't be able to use the
target anyway. (You ARE using a doctype, right?)

A popup is any window opened by script, be it javascript or vbscript or
Flash. Unrequested popups are the ones people block most often. That
means they opened without the user clicking on anything or initiating
some event.
A "new window" doesn't even exist in some user agents.

As to blockers, MOST won't block a new window opened as a direct result
of a user click, mouse action, or keypress. Perhaps your functions need
a re-write. You should not be opening unrequested windows. The function
that is fired when the user clicks has to be the one with the open in
it. I've had the most luck doing that, but my main browsers of concern
are Mozilla/Netscape/Firefox/Opera with the option to disallow
unrequested popups. I have not tested that in all the blockers available
for MSIE. Some of them block ALL calls to window.open.

Note that giving something a target in HTML doesn't guarantee it will
open in a new window. I can change that with my browser (mozilla) and
open it in a tab or set it to open in the current window and ignore your
target.

The only way to open a window in javascript is with window.open. There
is no magic other way that won't be blocked.

I have yet to see something that uses popups that truly requires them.


Jul 23 '05 #9
Frances Del Rio <fd***@yahoo.com> writes:
so I came up w/idea that instead of a pop-up opened w/window.open()
method we could open the video viewer in a regular new blank window,
<a href="__" target="_blank"> and resize... but how do you do this
while page is loading (w/o input from user??)


You can *try*:

<a href="..." target="_blank" id="foo"></a>
<script type="text/javascript">
document.links['foo'].click();
</script>
Won't work in all browsers, though.
/L
--
Lasse Reichstein Nielsen - lr*@hotpop.com
DHTML Death Colors: <URL:http://www.infimum.dk/HTML/rasterTriangleDOM.html>
'Faith without judgement merely degrades the spirit divine.'
Jul 23 '05 #10
Frances Del Rio wrote:
ok, I thank everyone for their comments/feedback... but I'd like to say
that where I work, we're an internet co. that mainly produces webcasts
for Fortune 500 cos., trade associations, some non-profits... we use
pop-ups for the video displays, we open a window that's approx 790x530,
What if the user has a desktop size that does not allow such large windows
to be opened?
on the left side is the video, on the right images that flip (or are
flipped by user) as video progresses.. this is a perfectly legitimate
use of pop-up windows..
No, it is not. Pop-ups are a Bad Thing. They eat much more resources than
required if abandoned.
there's no way we can do this in same window where users register, login,
There is. You are obviously not competent enough to make design decisions.
Get yourself educated.
etc (that has a nav frame on the left and on main frame pgs for
registration, login, etc..)
Frames are a Bad Thing. Use CSS and fixed layers instead.
This even works in IE with a small workaround.
if you go to www.foxnews.com and scroll down to where it says
"News 24/7" and click on a video link you will see what I mean..
Doing Bad Things just because others do Bad Things has never been
a reasonable excuse, if that.
[more incompetent blabla]
What you like or dislike is irrelevant. If you design/hack for a
customer, what the customer wants when it comes to such design
decisions should be irrelevant (and it is your job to explain why).
Functionality is relevant. The fish must eat the worm, not the
fisher.
and the thing is, going back to my situation at work, if a user goes to
main page and our sw detects this user is already registered and we have
their password stored or whatever this video viewer pops up
automatically, w/out any input from user, while pg is still loading in
many cases.. this is where the problem arises..
The problem arises *at least* with Windows XP Service Pack 2
which finally causes the (alas!) most used browser today to
block unrequested popups *by default*.
[...]
ok, I think I've written enough for now... ;)
[...]


And if you would saved us from that top-post, too, as strongly
recommended in the FAQ, it would be more appreciated.
PointedEars
Jul 23 '05 #11
On Mon, 26 Jul 2004 05:52:31 +0200, Thomas 'PointedEars' Lahn wrote:
The problem arises *at least* with Windows XP Service Pack 2
which finally causes the (alas!) most used browser today to
block unrequested popups *by default*.


Cool. I had previously rejected any attempt
(by the system) to update.. But that one is
*worth* it! I hit a page the other day that
had 2 pop-ups and 3 pop-unders.. :-O

--
Andrew Thompson
http://www.PhySci.org/ Open-source software suite
http://www.PhySci.org/codes/ Web & IT Help
http://www.1point1C.org/ Science & Technology
Jul 23 '05 #12
In article <2m************@uni-berlin.de>, fd***@yahoo.com enlightened us
with...

ok, I thank everyone for their comments/feedback... but I'd like to say
that where I work, we're an internet co. that mainly produces webcasts
for Fortune 500 cos., trade associations, some non-profits... we use
pop-ups for the video displays, we open a window that's approx 790x530,
on the left side is the video, on the right images that flip (or are
flipped by user) as video progresses.. this is a perfectly legitimate
use of pop-up windows..


Yes, it is, and it's used by a lot of multimedia and game sites, all of which
(from what I've noticed, anyway) have a disclaimer that effectively tells
people that they use popups and to turn off their blocker or control+click
(for some blockers) to allow the popups. :)
Heck, my favorite game spot uses popups and applets, two things I usually
tell people NOT to use. *smile*
If your content is worth it, you tell users about it and they'll decide they
like you enough to turn off blocking for you.

All blockers have a way to allow popups by some means. Some are
control+click, some you have to add the site to a list of allowed sites, etc.

There really isn't a good way around this issue. You just have to inform the
user about it and let them decide if they want to use your site by turning
off popup blocking or not.

My two cents...

--
--
~kaeli~
Is it possible to be totally partial?
http://www.ipwebdesign.net/wildAtHeart
http://www.ipwebdesign.net/kaelisSpace

Jul 23 '05 #13
Andrew Thompson wrote:
On Mon, 26 Jul 2004 05:52:31 +0200, Thomas 'PointedEars' Lahn wrote:
The problem arises *at least* with Windows XP Service Pack 2
which finally causes the (alas!) most used browser today to
block unrequested popups *by default*.


Cool. I had previously rejected any attempt
(by the system) to update.. But that one is
*worth* it! I hit a page the other day that
had 2 pop-ups and 3 pop-unders.. :-O


Use a Gecko-based browser and get popup blocking built-in. Or if you
must use IE, install the Google toolbar <url: http://toolbar.google.com/
/>. It blocks most (but not all) popups.

--
Grant Wagner <gw*****@agricoreunited.com>
comp.lang.javascript FAQ - http://jibbering.com/faq
Jul 23 '05 #14
On Mon, 26 Jul 2004 15:13:21 GMT, Grant Wagner wrote:
Cool. I had previously rejected any attempt
(by the system) to update.. (IE)
Use a Gecko-based browser and get popup blocking built-in. Or if you
must use IE,
b) Well, define 'must'? I have Moz/Opera/Lynx
installed for testing my pages, but use IE deliberately
so that I am aware of the quirks that may develop
between IE/Java*..

[ * I doubt we need to cover that ground again,
though there are some recent'ish developments that
I am not sure whether you are aware..
'unmsvm.exe/JVMClean'? ]
..install the Google toolbar <url: http://toolbar.google.com/
/>. It blocks most (but not all) popups.


Thanks for the tip, I will look into it..

(chuckles) Well now you mention it and I
look more closely at that link, it reminded
me of, ..yep there it is.
<http://groups.google.com/groups?th=ff7d82172abe9b65>

Hey.. I keep trying to convince people that pop-ups
are going the way of the dinosaurs (..and I will
have to update some of *my* applets to suit..)

Old habits and ways die hard..

--
Andrew Thompson
http://www.PhySci.org/ Open-source software suite
http://www.PhySci.org/codes/ Web & IT Help
http://www.1point1C.org/ Science & Technology
Jul 23 '05 #15

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

Similar topics

3
by: saiho.yuen | last post by:
Hi, Is anyone know what is the difference between Location.href and Window.location.href Thanks you very much:) Saiho
2
by: Brvsra | last post by:
Javascript Experts, I know very little about javascript and could use someone's help. I have created a function to send an email, listed below is the function. The function works fine, with...
3
by: Christian Hubinger | last post by:
Hi! I'm working on a page that uses javascript very much. My problem is now that i cannot redirect to another page in IE with window.location =<URL>; This command gets executed (proofed with...
18
by: Simula | last post by:
I am developing an HTML javascript application and I want to preserve state in a way that can be book-marked. I chose HTML anchors as a means of preserving state. When the application changes...
2
by: Raj | last post by:
Hi All, I have a problem with trying to refresh the parent window from child window in order to update data in the parent window. The sequence of events are 1) I click a button in the parent...
5
by: soni2926 | last post by:
Hi, I have a pop up window, that window needs to refresh the parent window when opened, I'm doing the following: window.opener.location.href(window.opener.location.href); problem I'm having...
4
by: MarkKM | last post by:
Hello, I'm having troubles with IE7 and the window.location function in an SVG file. This all works fine in IE6 using the Adobe SVG viewer but not in IE7, WHY? Please HELP! We use IE in Kiosk...
6
mikewagan
by: mikewagan | last post by:
hello guys, Javascript's been bugging on IE, and i'm trying to search for a solution for this answer but no luck. I have a select box as a navigation element. If a user clicks on an option, it...
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: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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
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,...
0
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...

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.