Solved

Help with browser differences

Posted on 2007-11-14
4
379 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
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 6

Expert Comment

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

Accepted Solution

by:
mtz1of4 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

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

Internet is a big network which is formed by connecting multiple small networks.It is a platform for all the users which are connected to it.Internet act as platform in different fields. Such as: Internet  as a collaboration platform. Internet  as…
I had to do a bit of research to find the answer to this question so I thought I'd share my results.  Due to our outdated mainframe systems, we need to downgrade IE9 to IE8 in order to stay compatible.  We also needed to downgrade Java.  In order to…
This Micro Tutorial will demonstrate how to add subdomains to your content reports. This can be very importing in having a site with multiple subdomains.
Shows how to create a shortcut to site-search Experts Exchange using Google in the Chrome browser. This eliminates the need to type out site:experts-exchange.com whenever you want to search the site. Launch the Search Engine Menu: In chrome, via you…

743 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

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now