By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,827 Members | 2,177 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,827 IT Pros & Developers. It's quick & easy.

Opening a popup window faster

P: n/a
Hello,

on our homepage, when pressing an anchor tag, a special sized popup
window opens via javascript. but it opens very slowly.

on other web pages, there are also javascript-opened windows, but they
load very very fast, within 2-3 seconds.

i tried several things such as :

// directly in href attribute
<a href="javascript:window.open('the_url','','toolbar =0, location=0,
directories=0, status=0, menuBar=0, scrollBars=1, resizable=0,
width=624, height=500, top=15');">test1</a>

// in an onclick event
<a href="#" onclick="javascript:window.open('the_url','','tool bar=0,
location=0, directories=0, status=0, menuBar=0, scrollBars=1,
resizable=0, width=624, height=500, top=15');">test2</a>
// or in a function, first open popup,
// then load content into popup via reference
var anotherPopup = null;
function openAnotherPopup() {
anotherPopup = window.open('','anotherPopup','width=600,height=32 3,status=no,toolbar=no,menubar=no,directories=no,l ocation=no,scrollbars=no,resizable=yes,alwaysRaise d=no,screenX=20,screenY=5,titlebar=yes,z-lock=yes,left='
+ (screen.width - 728) / 2 + ',top=' + (screen.height - 586) / 2);
anotherPopup.location = "the_url";
anotherPopup.focus();
}
in the web page i've mentioned before (the one that opens popups very
fast) the first approach is used.

i use IE 6.0, windows 2000 prof and have 1 gb ram.
the popups of our site doesn't open a bit faster even no other
application is running on my system.

firefox opens the popup very fast, ok, but how does it come, that IE
6.0 opens a popup of a site much faster than the popups of another ?
can anybody help with this problem ?
Jul 23 '05 #1
Share this Question
Share on Google+
3 Replies


P: n/a
On 30 Dec 2004 05:00:35 -0800, Mehmet Gunacti <ms*****@gmx.net> wrote:

[snip]
<a href="javascript:window.open('the_url','','toolbar =0, location=0,
directories=0, status=0, menuBar=0, scrollBars=1, resizable=0,
width=624, height=500, top=15');">test1</a>


1) It's almost always wrong to use the javascript: pseudo-protocol
in links[1]. In this particular case, it most certainly is. Never
open a pop-up like this. Not only will users without Javascript
be unable to reach the page, but people like me who middle-click
links[2] will get nothing but a blank page.
2) The feature string should not contain spaces.
3) You should never attempt to make a window fixed in size, nor
attempt to remove the status bar. Decent browsers won't let you,
anyway.

The more acceptable way to present that link would be:

<a href="http://www.example.com/" target="myWindow"
onclick="window.open(this.href, this.target,
'status,scrollbars,resizable,width=624,height=500, top=15');
return false;">

Now it will work for everyone.

Notice that I omitted several of the features - those that are missing are
automatically disabled (with an exception or two, like the title bar).

[snip]

Mike
[1] I would *always* consider it wrong on the Web.
[2] Middle-clicking a link in most (all?) tabbed browsers opens the
link in a new tab.

--
Michael Winter
Replace ".invalid" with ".uk" to reply by e-mail.
Jul 23 '05 #2

P: n/a
Mike,

actually it's the opening windows' size was not my decision, and i don't
want to quarrel with the programmers here. but i appreciate what you
explained and how a link should look like. i'll modify the way the popup
opens.

but the popup still opens very very slowly. the opener window freezes
until the popup appears. do you know a way to make this faster ?

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
Jul 23 '05 #3

P: n/a
On 30 Dec 2004 07:55:29 -0600, Mehmet Serkan Gunacti <ms*****@gmx.net>
wrote:
[...] the opening windows' size was not my decision,
It's not necessarily the size that's a problem, but the fact that original
code tried to prevent the window from being resized. What if a user
overrides the font sizes and makes them larger to compensate for their
poor eyesight? Thankfully the window would provide scrollbars, but it
would be much nicer if the user could make them unnecessary by making the
window bigger.

[snip]
but the popup still opens very very slowly. the opener window freezes
until the popup appears. do you know a way to make this faster ?


No, not really. The speed at which a new window opens will vary based on
what the window will contain (complex nested tables [which should be
avoided] will take longer to render than simple semantic mark-up), how
well the browser was written, and various load factors on the computer.
So, aside from making sure your mark-up is simple (and valid), I doubt
there is anything you can do.

Mike

--
Michael Winter
Replace ".invalid" with ".uk" to reply by e-mail.
Jul 23 '05 #4

This discussion thread is closed

Replies have been disabled for this discussion.