473,378 Members | 1,518 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,378 software developers and data experts.

Winopen function and browser behavior

I used the following script to allow me to bring up a list of events
for a given year by simply hovering the mouse over the filename. As
follows --

<script Language="JavaScript">
function winopen1(){
msg1=open
("","WINDOW1","toolbar=no,location=no,directories= no,status=no,menubar=no,scrollbars=no,resizable=no ,copyhistory=no,width=550,height=200");
msg1.location="1989H.htm"}
</Script>

Then....

<a href="1989H.htm" onMouseOver="winopen1();return true;"
onMouseOut="msg1.close();return true;">1989</a></font></td>

This is one example .... this is repeated about 20 times in the
program, one for each year of our history...

It works fine ... but not on all the browsers in our office. Most work
fine ... others (all IE) work fine on some dates; other dates, when
you hover, flash a blank page repeatedly until you move the mouse
away; almost as though it is looping ...

I notice that "about:blank" flashes briefly before the called page
comes up ... but that appears to be normal.... I have checked and
rechecked all coding, all brackets and semi-colons ... and it works
perfectly -- for me and for a few others.

Any ideas?

Thanks ...
Jul 20 '05 #1
1 5374
Marty Morris wrote:
I used the following script to allow me to bring up a list of events
for a given year by simply hovering the mouse over the filename. As
follows --

<script Language="JavaScript">
function winopen1(){
msg1=open
("","WINDOW1","toolbar=no,location=no,directories= no,status=no,menubar=no,scrollbars=no,resizable=no ,copyhistory=no,width=550,height=200");
msg1.location="1989H.htm"}
</Script>

Then....

<a href="1989H.htm" onMouseOver="winopen1();return true;"
onMouseOut="msg1.close();return true;">1989</a></font></td>

This is one example .... this is repeated about 20 times in the
program, one for each year of our history...

It works fine ... but not on all the browsers in our office. Most work
fine ... others (all IE) work fine on some dates; other dates, when
you hover, flash a blank page repeatedly until you move the mouse
away; almost as though it is looping ...

I notice that "about:blank" flashes briefly before the called page
comes up ... but that appears to be normal.... I have checked and
rechecked all coding, all brackets and semi-colons ... and it works
perfectly -- for me and for a few others.

Any ideas?

Thanks ...


about:blank flashes because you're calling window.open() without a URL.

The problem is most likely that win1.location doesn't yet exist as an object when you try to access it. I'd bet you're getting a JavaScript
error something about Access Denied.

I don't understand why you open the window, then set it's location. I also don't understand why you'd hard-code all the individual URLs all
over the place, try this:

<script type="text/javascript">
function winOpen(theURL, theTarget) {
var windowRef = window.open(theURL, theTarget,
"toolbar=no,location=no,directories=no,status=no,m enubar=no,scrollbars=no,resizable=no,copyhistory=n o,width=550,height=200");
return windowRef;
}
</script>

<a href="1989H.htm" onMouseOver="window[this.href] = winOpen(this.href, this.target);return true;"
onMouseOut="if (window[this.href]) window[this.href].close();return true;">1989</a>

Now each link gets it's own popup reference so you know what window you're closing, you're specifying the location in one place (the HREF
attribute of the link) and you can use the same function for *every* link that does the same thing instead of having 20 functions that all do
the same thing.

--
| Grant Wagner <gw*****@agricoreunited.com>

* Client-side Javascript and Netscape 4 DOM Reference available at:
* http://devedge.netscape.com/library/...ce/frames.html
* Internet Explorer DOM Reference available at:
* http://msdn.microsoft.com/workshop/a...ence_entry.asp
* Netscape 6/7 DOM Reference available at:
* http://www.mozilla.org/docs/dom/domref/
* Tips for upgrading JavaScript for Netscape 6/7 and Mozilla
* http://www.mozilla.org/docs/web-deve...upgrade_2.html
Jul 20 '05 #2

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

Similar topics

9
by: Penn Markham | last post by:
Hello all, I am writing a script where I need to use the system() function to call htpasswd. I can do this just fine on the command line...works great (see attached file, test.php). When my...
5
by: What-a-Tool | last post by:
Why is it that the following code displays "2005" in IE, but "105" in every other browser I've tried? var mydt = new Date(); var myyr = mydt.getYear(); document.write("<p>Year Test :...
2
by: laredotornado | last post by:
Hello, I am looking for a cross-browser way (Firefox 1+, IE 5.5+) to have my Javascript function execute from the BODY's "onload" method, but if there is already an onload method defined, I would...
5
by: Vinod Kumar | last post by:
Hi All, Can I access a Javascript function written in an ASP.NET from the codebehind (C#) of that page? If yes, kindly give the code snippet to do this. Thanks and Regards Vinod Kumar
56
by: Luke Matuszewski | last post by:
I am designing the library, which will hidden all its functions within singleton object ... So for clients they will use it like . eg. system.getElementWithId('ruler'); At library side, i...
28
by: fred.haab | last post by:
Not having server side scripting, I've been doing this for "last modified" tags on my pages: <div class="modified"> <script type="Text/JavaScript"> <!-- document.write("This page was last...
7
by: jmp | last post by:
(I hope this isn't considered too far off-topic.) I work as a developer on a browser product found on handheld devices, and I'm trying to specify behavior for the browser to make it "as...
16
by: petermichaux | last post by:
Hi, Does anyone have a a cross-browser setOpacity function that does not use browser sniffing? I looked at the Yahoo! UI function and it detects IE by looking for window.ActiveXObject. I also...
2
by: petermichaux | last post by:
Hi, It seems like determining element position in a web page is a difficult task. In the position reporting source code I've looked at there are special fixes for at least some versions of...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
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
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
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
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
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.