View Full Version : Popup works in FF but not IE
rjlstar
06-08-2008, 11:49 AM
http://www.only-jojo.com/temp/english/
I am having trouble with some Javascript. Click the comments link next to any news heading. A working popup to the comments will show up in Firefox, but a blank popup shows up in Internet Explorer 6.
<a onclick="window.open('news/comments.php?id=16', '_News', 'HEIGHT=600, WIDTH=600, resizable=yes, scrollbars=yes'); return false;" href="#">2 comments</a>
coothead
06-08-2008, 02:08 PM
Hi there rjlstar,
this problem was rather difficult to track down. :agree:
Although the IE popup window appeared blank, "View Source" did in fact reveal the page source.
My initial thought, of course, was does it validate.
It did not. Validation revealed some 30 errors. :supereek:
So I was preparing to add this link to my reply...
Why you should validate your code before asking for help (http://diveintomark.org/archives/2003/05/05/why_we_wont_help_you)
...but being Sunday and having nothing better to do, I corrected and validated the code.
Unfortunately, the page still remained blank in IE. :(
When this happens, Plan B is to remove a part of the code to see if that will effect a cure.
Taking out the head section did indeed bring content to page.
Examination of the head section eventually revealed the problem...
<script src="smileys.js" type="text/javascript" />
... which the validator, for some reason did not consider to be an error. :supereek:
Changing it to...
<script src="smileys.js" type="text/javascript"></script>
...solved your problem. ;)
Here is your corrected and validated page...
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>JoJo > Add News</title>
<link href="news.css" rel="stylesheet" type="text/css" />
<script src="smileys.js" type="text/javascript"></script>
</head>
<body>
<h3>Comments</h3><div class="comment">
<div class="commentHead"><b>
<a href="mailto:cia@mia.com">Reporter</a></b> @ <i>Jun, 8 2008 - 4:35 am</i></div>
<div class="commentBody">
And while JoJo has worked with tons of charities, she’s still learning, and says that what impacts her the
most are women’s issues. “As I grow older I learn more about them, and I do more of my own personal research,
and speak to people that are more educated about it. There’s so much that I want to do as far as the sex trade
and female genital mutilation. There’s a lot of things that I’m interested in and haven’t had the opportunity
to work with yet.”
</div>
</div>
<div class="comment"><div class="commentHead"><b>JoJo</b> @ <i>Jun, 8 2008 - 6:57 am</i>
</div>
<div class="commentBody">Hi. Thanks for posting this about me.
<img src="./interface/regularSmile.gif" alt="" />
I like it when people talk about me. I wish you were all my friends.
<img src="./interface/bigSmile.gif" alt="" /> I want Oli to be my boyfriend. He is hot.
<img src="./interface/knockedOut.gif" alt="" />
</div>
</div>
<a name="bottom"></a>
<h3>write a comment</h3>
<form method="post" action="?comments.php&id=16#bottom">
<table><tr>
<th><label for="name">name:</label></th>
<td><input id="name" name="name" type="text" size="25" maxlength="25" class="input" /></td>
</tr><tr>
<th><label for="email">email:</label></th>
<td><input id="email" name="email" type="text" size="35" maxlength="35" class="input" />
<i>(optional)</i>
</td>
</tr><tr>
<th><label>smileys:</label></th>
<td>
<img src="interface/bigSmile.gif" onclick="insertSmiley(':-D')" alt="" />
<img src="interface/cantLook.gif" onclick="insertSmiley(':-P')" alt="" />
<img src="interface/cry.gif" onclick="insertSmiley(':=(')" alt="" />
<img src="interface/devious.gif" onclick="insertSmiley('=:)')" alt="" />
<img src="interface/huh.gif" onclick="insertSmiley('o_0')" alt="" />
<img src="interface/knockedOut.gif" onclick="insertSmiley('x-)')" alt="" />
<img src="interface/puzzled.gif" onclick="insertSmiley(':-~')" alt="" />
<img src="interface/regularSmile.gif" onclick="insertSmiley(':-)')" alt="" />
<img src="interface/shocked.gif" onclick="insertSmiley(':-o')" alt="" />
<img src="interface/snooze.gif" onclick="insertSmiley('z:-)')" alt="" />
<img src="interface/tongue.gif" onclick="insertSmiley(':-P')" alt="" />
<img src="interface/unsure.gif" onclick="insertSmiley(':-/')" alt="" />
<img src="interface/upset.gif" onclick="insertSmiley(':-(')" alt="" />
</td>
</tr><tr>
<th><label for="message">message:</label></th>
<td><textarea name="message" rows="5" cols="5" id="message"></textarea></td>
</tr><tr>
<th></th>
<td><input type="submit" value="submit" class="submit" /></td>
</tr></table>
</form>
</body>
</html>
rjlstar
06-08-2008, 02:24 PM
Thanks. That works.
coothead
06-08-2008, 02:30 PM
No problem, you're welcome. :agree:
coothead
06-08-2008, 02:42 PM
Hi there rjlstar,
I notice that you have only changed the erroneous <script> but not used the validated page. :supereek:
Do you believe that to be a wise decision?
Your next problem may get this reply...
Why you should validate your code before asking for help (http://diveintomark.org/archives/2003/05/05/why_we_wont_help_you)
...rather than a solution. :agree:
rjlstar
06-13-2008, 01:24 AM
Hi coothead,
This is not my website. I am just helping out a girl by adding server-side scripting. She probably has a million invalid lines of code...
vBulletin® v3.6.7, Copyright ©2000-2009, Jelsoft Enterprises Ltd.