Solved

Help with browser differences

Posted on 2007-11-14
4
391 Views
Last Modified: 2013-12-08
I am writing an electronic card system for my company.  Everything is going great but now I have one problem between IE and Firefox.  When you view the card that was sent to you there is a Close Window button at the bottom.  This button works in IE but not in Firefox.  I can't figure out why.  Here is the code from each browser.  Any help is greatly appreciated.

FIREFOX
========
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<title>Exemplar CE eCards</title>
<link rel="stylesheet" href="eCardsStyleSheet.css" type="text/css" title="hires"/>
</head>

<body >

  <p align="center">
    <object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0" width="600" height="400">
      <param name="movie" value="Cards/exemplar_thankyou.swf">

      <param name="quality" value="high">
      <embed src="Cards/exemplar_thankyou.swf" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" width="600" height="400"></embed>
    </object>
</p>
  <p align="center">
    <textarea name="textarea" cols="70" rows="6">Another Test</textarea>
  </p>

  <p align="center" class="error">&nbsp;</p>

  <p align="center">
    <input name="Close" type="submit" id="Close" value="Close Window" onclick="javascript:window.close();">
</p>
</body>

</html>

IE 7.0
======


<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<title>Exemplar CE eCards</title>
<link rel="stylesheet" href="eCardsStyleSheet.css" type="text/css" title="hires"/>
</head>

<body >

  <p align="center">
    <object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0" width="600" height="400">
      <param name="movie" value="Cards/exemplar_thankyou.swf">
      <param name="quality" value="high">
      <embed src="Cards/exemplar_thankyou.swf" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" width="600" height="400"></embed>
    </object>
</p>
  <p align="center">
    <textarea name="textarea" cols="70" rows="6">Another Test</textarea>
  </p>

  <p align="center" class="error">&nbsp;</p>
  <p align="center">
    <input name="Close" type="submit" id="Close" value="Close Window" onclick="javascript:window.close();">
</p>
</body>

</html>
0
Comment
Question by:dyarosh
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
4 Comments
 
LVL 25

Expert Comment

by:imitchie
ID: 20282863
try just onclick="window.close();"
0
 

Author Comment

by:dyarosh
ID: 20283303
Didn't work.  Here is a link that you can use to see how it works in IE but not in Firefox.

http://www.development.exemplarce.org/eCards/PreviewCard.asp?code=5111142007121141&rid=126
0
 
LVL 7

Expert Comment

by:Dmitrii
ID: 20288110
onclick="window.open('','_parent','');window.close();"
0
 
LVL 30

Accepted Solution

by:
Marc Z earned 500 total points
ID: 20288999
dyarosh,
From http://developer.mozilla.org/en/docs/DOM:window.open#FAQ

New windows not opened by javascript can not as a rule be closed by JavaScript.

And from
http://developer.mozilla.org/en/docs/window.close
This method is only allowed to be called for windows that were opened by a script using the window.open method. If the window was not opened by a script, the following error appears in the JavaScript Console: Scripts may not close windows that were not opened by script.
0

Featured Post

[Webinar] Code, Load, and Grow

Managing multiple websites, servers, applications, and security on a daily basis? Join us for a webinar on May 25th to learn how to simplify administration and management of virtual hosts for IT admins, create a secure environment, and deploy code more effectively and frequently.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Citrix XenApp, Internet Explorer 11 set to Enterprise Mode and using central hosted sites.xml file.
Today, still in the boom of Apple, PC's and products, nearly 50% of the computer users use Windows as graphical operating systems. If you are among those users who love windows, but are grappling to keep the system's hard drive optimized, then you s…
Google currently has a new report that is in beta and coming soon to Webmaster Tool accounts. This Micro Tutorial will highlight new features for Google Webmaster Tools.
This Micro Tutorial will demonstrate how nuggets on the Web are formatted by using Chrome Developer Tools. These tools would not only view the site's CSS but it can also modify it and save the CSS to use on your own site.

739 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question