...

View Full Version : window.open and IE



amber417
07-31-2006, 06:35 PM
The javascript works with firefox and safari but in internet explorer I can't get the href to popup in a new window or at the smaller size. I'm pretty green at Java script so any help would be greatly appresiated. Also, do I need the "SCRIPT LANGUAGE" in the head or can the javascript just be attached with the href?

<html>
<head>
<title>Osagian site</title>
<meta name="keywords" content="type in keep, words, that, will, pick up in a google search">
<meta name="description" content="type in keep, words, that, will, pick up in a google search">
<STYLE TYPE="text/css" MEDIA=screen>
<!--
load {padding-top: 0}
h1 {padding-top: 10%; padding-left: 10%; font size: 25px; font-family: Helvetica, sans-serif; font-weight: normal; color: navy;}
p {}
-->
</STYLE>
<SCRIPT LANGUAGE="javascript1.2">
function poponload()
{
"osagiansite=window.open(' ', 'osagian site',config='fullscreen=yes,location=no,resizable=no,scrollbars=no,menubar=no,status=yes,titlebar=n o,toolbar=no,width=800,height=600,left=240,top=100,breplace=true'); return false"}
</SCRIPT
></head>

<body>
<div id="load">
<h1><a href="Osagian%20site.html.html" onclick="javascript:window.open('www.osagian.com','Osagian Site',config='fullscreen=yes,location=no,resizable=no,scrollbars=no,menubar=no,status=yes,titlebar=n o,toolbar=no,width=800,height=600,left=240,top=100,breplace=true'); return false">Enter Site</a></h1>
</div>
</body>
</html>

Thanks for any help you can give.

Bill Posters
07-31-2006, 06:47 PM
css

#load {padding-top: 0}
h1 {padding-top: 10%; padding-left: 10%; font size: 25px; font-family: Helvetica, sans-serif; font-weight: normal; color: navy;}

js

function poponload(url) {

var osagiansite=window.open(url, 'osagian site','fullscreen=yes,location=no,resizable=no,scrollbars=no,menubar=no,status=yes,titlebar=no,toolb ar=no,width=800,height=600,left=240,top=100');

}

markup

<div id="load">
<h1><a href="osagian_main.html" onclick="poponload(this.href); return false;">Enter Site</a></h1>
</div>

but...

Entry pages are a bad idea, particularly ones that are there simply to facilitate...
...Popup windows: These aren't a popular way to present the main body of a site.
If you feel that you really want the site in a new window, at least offer users a link which opens in the current window.

e.g.

<a href="osagian_main.html">Enter Site</a> (<a href="osagian_main.html" onclick="poponload(this.href); return false;">Open in new Window</a>)

Meta Keywords are ignored by Google.
Avoid having spaces in your file names (and try to keep file names to lowercase).
Putting 'Enter Page' within h1 elements is a complete waste.

There's quite a bit that's fundamentally missing the point with the code that you had.

_Aerospace_Eng_
07-31-2006, 06:56 PM
IE needs to have the window name as one word rather than 2. Try this

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title>Osagian site</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta name="Keywords" content="type in keep, words, that, will, pick up in a google search">
<meta name="Description" content="type in keep, words, that, will, pick up in a google search">
<style type="text/css">
html, body {
margin:0;
padding:0;
}
h1 {
padding-top: 10%;
padding-left: 10%;
font-size: 25px;
font-family: Helvetica, sans-serif;
font-weight: normal;
color: navy;
}
h1 a {
color:navy;
text-decoration:underline;
background-color:inherit;
}
h1 a:hover {
text-decoration:none;
}
</style>
<script type="text/javascript">
function poponload(url)
{
osagiansite = window.open(url,'osagiansite','fullscreen=1,location=0,resizable=0,scrollbars=0,menubar=0,status=1,t itlebar=0,toolbar=0,width=800,height=600,left=240,top=100');
}
</script>
</head>
<body>
<div id="load">
<h1><a href="http://www.osagian.com" onclick="poponload(this.href);return false">Enter Site</a></h1>
</div>
</body>
</html>

amber417
07-31-2006, 08:42 PM
The reason for the pop-up is because the new site is in flash and I'm trying to control the window size. I tried the code from both posts and the IE problem is still occurring. Any other suggestions? Like I said, this is all new for me so even critical feedback is wanted.

felgall
07-31-2006, 09:15 PM
Mobile phones and other PDA type devices don't have a very big screen and many wont understand flash. What will those visitors to your site see?

What will blind people who visit your site hear in their web reader if all of the content is flash?

What will people with javascript disabled see if you are relying on Javascript to open a new popup window?

There goes at least 10 or 15% of your potential audience.

_Aerospace_Eng_
08-01-2006, 06:32 AM
The reason for the pop-up is because the new site is in flash and I'm trying to control the window size. I tried the code from both posts and the IE problem is still occurring. Any other suggestions? Like I said, this is all new for me so even critical feedback is wanted.
I can understand Bill's not working because he had the space in the name in the JS function but mine should work as I did test it and it worked just fine in IE. Can you post a link to a test page? Also I was just going off your original JS function, you do realize that you told IE to go fullscreen?



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum