473,382 Members | 1,348 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,382 software developers and data experts.

page not loading in open pop up

I am opening pop up windows from a hint button on several pages in my
site. If the user leaves the pop up window open from a previous page, I
would like the new hint to open in that window.

I thought that by giving the pop-ups the same name it should work (see
code below) but it isnt. Every time a user clicks on the hint button
the popup opens in a new window regardless of the fact that a previous
hint window is open .

here is my code that calls the function from an html page (there is
also some rollover code in it):

<a href="javascript:open_pop_hint('ex3_n2_hint.html', 'hint');"
onMouseOut="MM_swapImgRestore()"
onMouseOver="MM_swapImage('Image43','','../images/button_hint_on.gif',1)">

And here is the function that is called from an external javascript
file.

//open hint popup
function open_pop_hint(path, targ)
{
litwin = window.open(path,
targ,'width=520,height=200,toolbar=no,location=no, status=yes,menubar=yes,scrollbars=yes,resizable=ye s');

if
(parseFloat(navigator.appVersion.substring(0,navig ator.appVersion.indexOf("
")))>=3.0)
{
litwin.focus();
}
}

Any help would be greatly appreciated I keep staring at the code and I
dont see where the problem is and I cant find anything on the web about
it. Everything seems to be about how this should work.

PS. the most baffling thing of all is that I used this same code on an
old site and it worked as expected.

thanks in advance

Jul 23 '05 #1
4 1624
In article <11**********************@o13g2000cwo.googlegroups .com>,
an*******@yahoo.com enlightened us with...
I am opening pop up windows from a hint button on several pages in my
site. If the user leaves the pop up window open from a previous page,


There's your problem. From a PREVIOUS page. That means all variables are
lost.
Unless you use a frameset (and hold the variables in global scope of a page
that doesn't change), you can't do this. A frameset has way too many cons to
use it just for something like this.

--
--
~kaeli~
Any sufficiently advanced technology is indistinguishable
from magic.
http://www.ipwebdesign.net/wildAtHeart
http://www.ipwebdesign.net/kaelisSpace

Jul 23 '05 #2
Thank you for replying so promptly, I really appreciate your taking the
time to help me.

The only thing about the mystery is that I just checked my old website
that uses the exact same code and it doesnt need frames for the html
page to continue to open in a pop up that was opened with the same
name. Even if you are on a different page? I'm looking at it in IE5 on
both a PC and a Mac.

kaeli wrote:
In article <11**********************@o13g2000cwo.googlegroups .com>,
an*******@yahoo.com enlightened us with...
I am opening pop up windows from a hint button on several pages in my site. If the user leaves the pop up window open from a previous
page,
There's your problem. From a PREVIOUS page. That means all variables are lost.
Unless you use a frameset (and hold the variables in global scope of a page that doesn't change), you can't do this. A frameset has way too many cons to use it just for something like this.

--
--
~kaeli~
Any sufficiently advanced technology is indistinguishable
from magic.
http://www.ipwebdesign.net/wildAtHeart
http://www.ipwebdesign.net/kaelisSpace


Jul 23 '05 #3
In article <11**********************@f14g2000cwb.googlegroups .com>,
an*******@yahoo.com enlightened us with...
Thank you for replying so promptly, I really appreciate your taking the
time to help me.

The only thing about the mystery is that I just checked my old website
that uses the exact same code and it doesnt need frames for the html
page to continue to open in a pop up that was opened with the same
name. Even if you are on a different page? I'm looking at it in IE5 on
both a PC and a Mac.


IE5 was buggy and allowed a lot of things other browsers didn't/don't allow.

Did you try with IE6 WinXP SP2? If not, post the URL and I'll take a look at
it when I get home.

That was the only idea I had, anyway.

I have one more idea...
The variable you use to define the window -- you DID remember to make it
global, right?

function open_pop_hint(path, targ)
{
litwin = window.open(path, ...

You need to have a
var litwin = null;
BEFORE (not inside) the function. Otherwise the variable is local to the
function.

Did that help any?

--
--
~kaeli~
Time flies like an arrow. Fruit flies like a banana.
http://www.ipwebdesign.net/wildAtHeart
http://www.ipwebdesign.net/kaelisSpace

Jul 23 '05 #4
thank you so much I had a mis-spelling in the global variable! and now
it works.

Thanks for all your help.
Ana

Jul 23 '05 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

8
by: Michael G. Schneider | last post by:
With Windows 2003 Server... Imagine the following scenario: there is a simple ASP page, for example just a single Response.Write statement. There is a virtual directory pointing to the...
4
by: Sjaakie Helderhorst | last post by:
Hi, I wrote an ASP-page which allows friends to upload a datafile which will be processed and stored in a database. Because large files take some time to process I want to open a popup 'Please...
5
by: Alan | last post by:
While not rs.eof <td><%=rs("InvoiceNo")%></td> <td><%=rs("Name")%></td> <td><a href="InvoicePrint.asp?WInv=<%=rs("InvoiceNo")%>"></a></td> <td>Print this invoice</td> rs.MoveNext Wend Now...
4
by: Jake Lewis | last post by:
I have an HTML page that loads fine including the .js file <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> <title>Untitled Document</title> <script...
16
by: jaialai technology | last post by:
I want to reload a url in a browser window so I do something like this: open(window.location.href= "www.yahoo.com"); ok, so now I want to do something when that page is done loading completely....
1
by: roni | last post by:
how can i open new page (in new instance of internet explorer) ,when loading other page ?
6
by: snazzy | last post by:
I have a problem where using innerHTML to rewrite a DIV or removeChild to kill a DIV that either of them, if excuted before the page is done loading will stop the page in its tracks. ...
2
by: Yogi_Bear_79 | last post by:
I have a script that parses window.location.hash to figure out which xml file to load. The xml files populate a page on a framed site. The code works correctly to a point. If I have a seperate...
2
by: dana lees | last post by:
Hi, I am developing a c# asp.net application. I have a button which when i click on i open a pdf file. Since the pdf file is very very large i would like to open a window that says "Loading...
2
dlite922
by: dlite922 | last post by:
Hey guys been a while since I needed your help. I've got a reporting system (yes same old one) , one button runs the report and builds the html table into the page all nice with CSS, etc, the...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.