PDA

View Full Version : multiple pop-ups



kodiacat
08-27-2007, 04:29 PM
Ok I have a pop-up window: Tips inside this pop-up I have a list of tips and have a link to another pop-up that opens in a new window, so now I have two pop-ups. If I add: <a href="javascript:window.close()">Close this window</a> to my second pop-up it creates the desired effect of creating a link for closing the second pop-up, however it changes the first pop-up also to something weird like: CLOSE THIS WINDOW">TIPS ... I'm sure that it is something quite simply that I'm missing, but I would appreciate any help or advice that anyone could give. Thank you.

This is the page for the first pop-up:

<?lassoscript
/*
This is the search tips pop up window;
Created on 8/1/2007 by kodiacat;
*/
?>
<html>
<head>
<title>Search Tips For Test</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<link rel="stylesheet" type="text/css" href="../includes/test_styles.css">
<script language="JavaScript">
var newwindow;
function test_tips(url)
{
newwindow=window.open('test_tipswin.lasso', 'new', 'height=375, width=400, center=100, resizeable=yes, scrollbars=yes');
if (window.focus) {newwindow.focus()}
}
</script>
</head>

<body>
<div>
<h3><b>Search Tips</b></h3>
<hr/>
<p>The search form can be used to search for questions by Keywords and/or Category from the Tips database.</p>
<ul>
<li> + denotes a contains search by keyword.</li>
<li> - denotes a search excluding a keyword.</li>
<li>For Example: searching for <b> '-delete' +'add' </b>would result in all Tips that contain add as a keyword, but do not contain delete as a keyword. </li>
<li>Required Keyword - <b>+add, +delete</b> would result in all Tips's which contain both the word "add" and the word "delete". </li>
<li>Comma's are not necessary, and could affect your search results.</li>
<li>Entering two words without any operators in front ( i.e. <b> 'delete' 'add' </b> or one word <b>'delete' </b>)will produce a contains search on the keywords field where either delete or add is present or just delete is present.</li>
<li>You may search by category and keyword</li>
<li>Entering nothing will find all Tips</li>
</ul>
<hr />
<font class="fieldtitle"><a href="javascript:test_tips('test_tipswin.lasso');" title="[include: 'test_tipswin.lasso']">Tips</a></font>
<div align=center><a href="javascript:window.close()">Close this window</a></div>
</div>
</body>
</html>

Second Pop-up window page:


This is just a test.

<a href="javascript:window.close()">Close this window</a>
//This close link will change the Tips pop-up link for the original pop-up window to this: CLOSE THIS WINDOW">TIPS the pop-up link still functions as it should, but it looks odd.

jscheuer1
08-27-2007, 05:05 PM
Instead of:


<a href="javascript:window.close()">Close this window</a>

use:


<span onclick="window.close();">Close this window</span>

kodiacat
08-27-2007, 05:38 PM
Instead of:


<a href="javascript:window.close()">Close this window</a>

use:


<span onclick="window.close();">Close this window</span>

Heh, Thanks:
hrmm, I tried this, and now the "close this window link in pop-up2 doesn't work, just displays plain text: "close this window", and pop-up win 1 displays this: CLOSE THIS WINDOW">TIPS and this links to pop-up win2....
(Not sure if I explained this bit right:)It shouldn't show the "close this window" at all in the first pop-up since it already has a window.close link...Maybe a screen-shot will help give a visual of what I see:

jscheuer1
08-27-2007, 07:30 PM
Looking at your code, it appears as though you are also using some server side code. It looks like a proprietary form of PHP - lassoscript, that I have never heard of. This, or the way that you are using it may be the problem.

A link from one page or even parts of it should never appear on another, unless you are doing something to make it do that.

I'd try getting rid of this:


title="[include: 'test_tipswin.lasso']"

kodiacat
08-27-2007, 08:36 PM
Hey thanks actually this was and wasn't it, see if I took this out it would work, but I want the text from the pop-up to display as a title/hover effect.
I learned that you aren't supose to put anything other than text into a title attribute. The solution was to take the window.close function out of the second pop-up/title include, and to instead include the pop-up into a template that displayed the pop-up instead, and that includes the close this window link.
Hopefully this will make sense.
Yes I am using server side code similiar to php: http://www.lassosoft.com
Thank you for your helping lead me in the right direction.