Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

window.open() slow in IE? Other Options? 1

Status
Not open for further replies.

joelwenzel

Programmer
Jun 28, 2002
448
I need to create a popup window. I was planning on using window.open() but it is really slow in IE. Are there any other options
 
I have come up with a solution.

window.open('url') works quickly. However, if I add stuff like window.open('url','name', 'menubar=no') it is much slower. I found that by placing javascript settings (such as the following) in the url to be opened rather than in the open() function, the speed is much faster.

<script language=javascript>
window.resizeTo(100,100);
window.moveTo(100,100);
</script>

My problem now is that the page loads first to the full size and then resizes to the correct size a few milliseconds later (I can see it resize). Is there any way to get the javascript to execute before the window opens? it is currently located in the head tags.
 
You could set a couple of parameters to make the window create off the screen somewhere. Then get it to apply all of your code and then move it back.
Code:
window.open('url','name', top=10000, left=10000)
window.resizeTo(100,100);
etc...
Code:
window.moveTo(100,100);
 
normally it shouldn't be that slow. Check that your IE is properly configured. It should be a matter of a few milliseconds.

What are the specs of your machine? Gary Haran
 
it is a pIII 600, 256megs ram.

I am quite supprised that it is so slow as well. In netscape, popups open very quickly
 
try the following :

- defrag your hard drive (takes a few hours).
- reinstall your ie.
- make sure you dont have spyware (kazaa for example).

Some of these may interfere with IE.
Gary Haran
 
I have this slowness as well, and it occurs on 3 different PCs so it is not set-up.

I discovered something that seems very odd - the speed depends directly on the number of other windows IE has open, that is if there is only one it takes a second, if 10 others it takes nearly 10 seconds. What on earth is IE doing?

Trying different options on the open, it seems it is not the third parameter (height= etc) that affects it, but the second parameter (window name) - make this '' and it opens instantly. OK, it has to check if a window of that name exists if you give a name, but 10 seconds??

Unfortunately, missing out the name is not a solution for me.
 
thanks. I was wondering why it was taking so long. You were definately right about the title thing. Once it was gone, the window opened very quickly
 
Hi,

Its a known problem with IE, but thats MS software for you

James
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top