serone
10-04-2009, 05:38 PM
1) Script Title: Window 1 (iframe content)
2) Script URL (on DD): http://dynamicdrive.com/dynamicindex8/dhtmlwindow/index.htm
3) Describe problem:
I am a newbe to both Window Widget and javascript and am a little lost. I would like to use the 'Google' window script sample:
<code>
<!-- 1) DHTML Window Example 1: -->
<script type="text/javascript">
<!--
var googlewin=dhtmlwindow.open("googlebox", "iframe", "http://somepage.com/memlog.html", " ", "width=510px,height=220px,resize=0,scrolling=0,center=1", "recal")
googlewin.onclose=function(){ //Run when window is being closed (return false to cancel action):
return window.confirm("Close window?")
-->
}
</script>
</code>
Which works ok. It opens the memlog.html window over the current page. My problem is in closing the created window using buttons on the memlog page. Here is the memlog.html code:
<code>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<?xml-stylesheet type="text/css" href="stylesheet.css"?>
<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">
<head>
<title>Wire Login</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<meta name="description" content="Test website." />
<meta name="keywords" content="German" />
<link rel="stylesheet" href="windowfiles/dhtmlwindow.css" type="text/css" />
<script type="text/javascript" src="windowfiles/dhtmlwindow.js">
/***********************************************
* DHTML Window Widget- © Dynamic Drive (www.dynamicdrive.com)
* This notice must stay intact for legal use.
* Visit http://www.dynamicdrive.com/ for full source code
***********************************************/
</script>
</head>
<body bgcolor="#cococo" oncontextmenu="return false">
<!-- <form name="test" action="action"> -->
<div align="center" style="color: red; font-weight: bold; font-size: 20pt">Member Login</div>
<br /><br />
<p align="center">
Username <input type="text" name="uname" size="20" />
<img src="images/transparent.gif" alt="space" />
Password <input type="password" name="pw" size="20" />
</p>
<p align="center">
<input type="button" name="login" value="Login" onclick="dhtmlwindow.close(this._parent)" />
<img src="images/transparent.gif" alt="space" />
<input type="button" name="cancel" value="Cancel" onclick="t.close()" />
<img src="images/transparent.gif" alt="space" />
<input type="button" name="close" value="Close" onclick="windowinstance.close()" />
<img src="images/transparent.gif" alt="space" />
<input type="button" name="close" value="Close" onclick="googlewin.close()" />
<img src="images/transparent.gif" alt="space" />
<a href="#" onclick="googlewin.close; return false">Close Window</a>
<input type="button" name="close" value="Close" onclick="windowinstance.close()" />
</p>
<!-- </form> -->
</body>
</html>
</code>
No matter which way I try, none of the buttons work to close the page. What am I doing (or not doing) that's wrong??
SER
2) Script URL (on DD): http://dynamicdrive.com/dynamicindex8/dhtmlwindow/index.htm
3) Describe problem:
I am a newbe to both Window Widget and javascript and am a little lost. I would like to use the 'Google' window script sample:
<code>
<!-- 1) DHTML Window Example 1: -->
<script type="text/javascript">
<!--
var googlewin=dhtmlwindow.open("googlebox", "iframe", "http://somepage.com/memlog.html", " ", "width=510px,height=220px,resize=0,scrolling=0,center=1", "recal")
googlewin.onclose=function(){ //Run when window is being closed (return false to cancel action):
return window.confirm("Close window?")
-->
}
</script>
</code>
Which works ok. It opens the memlog.html window over the current page. My problem is in closing the created window using buttons on the memlog page. Here is the memlog.html code:
<code>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<?xml-stylesheet type="text/css" href="stylesheet.css"?>
<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">
<head>
<title>Wire Login</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<meta name="description" content="Test website." />
<meta name="keywords" content="German" />
<link rel="stylesheet" href="windowfiles/dhtmlwindow.css" type="text/css" />
<script type="text/javascript" src="windowfiles/dhtmlwindow.js">
/***********************************************
* DHTML Window Widget- © Dynamic Drive (www.dynamicdrive.com)
* This notice must stay intact for legal use.
* Visit http://www.dynamicdrive.com/ for full source code
***********************************************/
</script>
</head>
<body bgcolor="#cococo" oncontextmenu="return false">
<!-- <form name="test" action="action"> -->
<div align="center" style="color: red; font-weight: bold; font-size: 20pt">Member Login</div>
<br /><br />
<p align="center">
Username <input type="text" name="uname" size="20" />
<img src="images/transparent.gif" alt="space" />
Password <input type="password" name="pw" size="20" />
</p>
<p align="center">
<input type="button" name="login" value="Login" onclick="dhtmlwindow.close(this._parent)" />
<img src="images/transparent.gif" alt="space" />
<input type="button" name="cancel" value="Cancel" onclick="t.close()" />
<img src="images/transparent.gif" alt="space" />
<input type="button" name="close" value="Close" onclick="windowinstance.close()" />
<img src="images/transparent.gif" alt="space" />
<input type="button" name="close" value="Close" onclick="googlewin.close()" />
<img src="images/transparent.gif" alt="space" />
<a href="#" onclick="googlewin.close; return false">Close Window</a>
<input type="button" name="close" value="Close" onclick="windowinstance.close()" />
</p>
<!-- </form> -->
</body>
</html>
</code>
No matter which way I try, none of the buttons work to close the page. What am I doing (or not doing) that's wrong??
SER