Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Help with browser differences

Posted on 2007-11-14
4
Medium Priority
?
396 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 7

Expert Comment

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

Accepted Solution

by:
Marc Z earned 2000 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

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

I recently found myself in a Corporate Situation where the client had requested blocking access to any and all websites except his own Domain? Easy? I am sure this would be your answer but their requirement was, this has to be done without using…
Several part series to implement Internet Explorer 11 Enterprise Mode
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.
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…

886 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