Wrox Programmer Forums
|
Javascript How-To Ask your "How do I do this with Javascript?" questions here.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Javascript How-To section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old May 18th, 2005, 02:54 PM
Registered User
 
Join Date: May 2005
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
Default Event handler problem

Why doesn't this script work in Internet explorer but in Mozilla firefox it work fine
In exploer I only got the 'bye now' message when I push the send button.
Please HELP!!!!

http://medlem.spray.se/carro82/open.php
[code]
//Open.php
<?
include ("window.php");
?>
 <?php
 echo "<form>
 <input type=\"button\" name=\"submit\" value=\"Open window\" onclick=\"WinOpen()\">
 </form>";
 ?>
<script language="JavaScript">
var msg=null;
function WinOpen() {
  msg=open("","displayWindow","toolbar=no,directorie s=no,menubar=no,width=600, height=600 resizable=yes" );
  if(msg == null)
    alert('Popup was blocked');
  msg.document.write("<HEAD><TITLE>Window!</TITLE></HEAD>");
  msg.document.write("<html><head><title>Window</title>");
  msg.document.write("<meta http-equiv='Content-Type' content='text/html' charset=iso-8859-1'>");
  msg.document.write("</head>");
  msg.document.write("<frameset rows='*' cols='65%,35%' framespacing='1' frameborder='1' border='1' >");
  msg.document.write("<frame src='file1.php' name='bottomFrame' scrolling='NO' resizable=yes >");
   msg.document.write("<frame src='file2.php' name='bottomFrame' scrolling='AUTO' resizable=yes ></frameset");
  msg.document.write("<noframes><body></body></noframes></html>");
}

</script>
//file1.php
<html>
<head>
<meta http-equiv="refresh" content="2"; URL="file1.php">
<?php
echo "frame1";
?>
</head>
</html>

//file2.php
<html>
<head>
<body onunload="alert('bye now!');">
<form method="post" action="file2.php">
<textarea name="meddelande" cols="30" rows="7" scrolling="NO" noresize>
 
Old May 20th, 2005, 03:30 PM
Registered User
 
Join Date: May 2005
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
Default

I think I solved why it doesn't work. I think it has to do with frame. If i don't use frames in the script it works fine.
Is there someone that can tell me how onunload and onload work with frames. And give me some script that works.

solution






Similar Threads
Thread Thread Starter Forum Replies Last Post
HOW TO ADD AN EVENT HANDLER pallone .NET Framework 2.0 10 September 16th, 2008 12:28 PM
Mouse Event Handler daniel.mihalcea C# 2008 aka C# 3.0 1 September 8th, 2008 06:30 AM
Event handler samir_katore Pro VB 6 6 June 8th, 2006 01:22 PM
PreDefined Event Handler mark C# 1 June 7th, 2003 04:47 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.