Home Tutorials Forums Articles Blogs Movies Library Employment Press

Go Back   ActionScript.org Forums > Supporting Technologies > HTML and JavaScript

Reply
 
Thread Tools Rate Thread Display Modes
Old 03-29-2005, 10:24 AM   #1
wizzackr
Registered User
 
Join Date: Dec 2004
Posts: 8
Default why doesn't IE like this script?

ok, i've been using this script for popping up a centered window, which firefox executes without a problem, but IE gives me an "error in page" and doesn't open anything at all. what's wrong with it?

HTML Code:
<SCRIPT LANGUAGE="JavaScript">
<!--

function NewWindow(url, windowName, w, h, scroll) {
	var winl = (screen.width - w) / 2;
	var wint = (screen.height - h) / 2;
	winprops = 'height='+h+',width='+w+',top='+wint+',left='+winl+',scrollbars='+scroll+',resizable';
	win = window.open(url, windowName, winprops);
	if (parseInt(navigator.appVersion) >= 4) { 
		win.window.focus(); 
	}
}

// -->
</script>
or respectively:

HTML Code:
<a href="javascript:NewWindow('whatever.html','name','800','600','no')">
help will be greatly appreciated, i'm going nuts here...
thanks in advance,
j
wizzackr is offline   Reply With Quote
Old 03-29-2005, 11:12 AM   #2
[Sx]
&gt;Teaching in Progress&lt;
 
[Sx]'s Avatar
 
Join Date: Mar 2005
Location: Serbia
Posts: 666
Send a message via ICQ to [Sx] Send a message via MSN to [Sx] Send a message via Yahoo to [Sx]
Default

Hmmm... from all I can see, you don't have defined 'resizable' parameter, so that's what might cause IE to error... Either remove 'resizable' from the winprops variable, or add it some value (=0 to disable resize, or =1 to enable it...

Hope it helps...
__________________
_______________
http://www.TopFlashers.com
[Sx] is offline   Reply With Quote
Old 03-29-2005, 02:19 PM   #3
Boskic.com
Senior Member
 
Boskic.com's Avatar
 
Join Date: Mar 2005
Location: Serbia (Zemun)
Posts: 122
Lightbulb This works

Code:
<SCRIPT type="text/javascript">
function NewWindow(url, windowName, w, h, scroll) {
var winl = (screen.width - w) / 2;
var wint = (screen.height - h) / 2;
winprops = 'height='+h+',width='+w+',top='+wint+',left='+winl+',scrollbars='+scroll+',resizable';
win = window.open(url, windowName, winprops);
if (parseInt(navigator.appVersion) >= 4) { win.window.focus(); }
}
</script>
and
Code:
<a href="javascript:NewWindow('whatever.html','name','800','600','no')">Klik</a>
Boskic.com is offline   Reply With Quote
Old 03-29-2005, 04:55 PM   #4
wizzackr
Registered User
 
Join Date: Dec 2004
Posts: 8
Thumbs up

thanks guys, thanks boskic - got it and it works like a charm.
wizzackr is offline   Reply With Quote
Old 04-13-2005, 02:20 AM   #5
third EYE
Banned from Kirupa x2
 
third EYE's Avatar
 
Join Date: Aug 2004
Location: Yukon, Canada
Posts: 65
Default

what how??? I get an invalid argument... wtf am I doing wrong??
third EYE is offline   Reply With Quote
Reply


Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 08:26 AM.

///
Follow actionscriptorg on Twitter

 


Powered by vBulletin® Version 3.8.5
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Ad Management plugin by RedTyger
Copyright 2000-2013 ActionScript.org. All Rights Reserved.
Your use of this site is subject to our Privacy Policy and Terms of Use.