Solved

Help with browser differences

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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Java 1603 Error 3 50
Citrix and Internet Explorer Problem 3 111
Render HTML in a desktop app, not using a browser 4 74
set url:tel to a website 3 16
It's here again; Microsoft is launching a new version of Internet Explorer: Internet Explorer 9, with noticeable changes on its interface, functions and new tools. As they say on its promotional video: "It's time to play, on a more beautiful web", f…
Several part series to implement Internet Explorer 11 Enterprise Mode
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.
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…

863 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

23 Experts available now in Live!

Get 1:1 Help Now