PDA

View Full Version : javascript doesn't work in IExplorer (simple popup)


JeroenM
11-17-2004, 03:37 PM
Just as I was cheering the script worked it turns out not to work in IE.
It works in all other browsers though.
Is there an IE bug I should know?

This is the site:
http://users.pandora.be/jeroenm/
Clicking the small images should open a larger.

thanks

Jeroen

eRad
11-17-2004, 04:05 PM
well in IE there is a javascript error saying Invalid Argument pointing to line 101

have a look / post the code ?

coothead
11-17-2004, 04:53 PM
Hi there JeroenM,

I.E. does not like...grote foto here...
var popup = window.open('','grote foto',config='left='+l+',top='+t+',width='+breedte+',height='+hoogte+',toolbar=0');

I suggest that you modify the function like this...
function groot(url)
{
var breedte = 500;
var hoogte = 340;
var l=screen.width/2-breedte/2; /*this will center the pop-up horizontally*/
var t=screen.height/2-hoogte/2; /*this will center the pop-up vertically*/
var popup = window.open('','grote_foto','left='+l+',top='+t+',width='+breedte+',height='+hoogte+',toolbar=0');
popup.document.write("<html><body style='background: url(achtergrond_grijs.jpg); text-align: center;margin:8px;padding:0px;;'><img style='border:solid 1px #000' src="+url+" alt='kleine foto in het groot'><\/body><\/html>");
popup.document.close();
popup.focus();
}