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

How do I use this code multiple times on a page

Hi there. Working on my site currently and I would like to know how I can use this code more than once on the page

Expand|Select|Wrap|Line Numbers
  1. <script language="JavaScript">
  2. <!-- 
  3. // This is the function that will open the
  4. // new window when the mouse is moved over the link
  5. function open_new_window() 
  6. {
  7. new_window = open("","hoverwindow","width=300,height=200,left=10,top=10");
  8.  
  9. // open new document 
  10. new_window.document.open();
  11.  
  12. // Text of the new document
  13. // Replace your " with ' or \" or your document.write statements will fail
  14. new_window.document.write("<html><title>JavaScript New Window</title>");
  15. new_window.document.write("<body bgcolor=\"#FFFFFF\">");
  16. new_window.document.write("This is a new html document created by JavaScript ");
  17. new_window.document.write("statements contained in the previous document.");
  18. new_window.document.write("<br>");
  19. new_window.document.write("</body></html>");
  20.  
  21. // close the document
  22. new_window.document.close(); 
  23. }
  24.  
  25. // This is the function that will close the
  26. // new window when the mouse is moved off the link
  27. function close_window() 
  28. {
  29. new_window.close();
  30. }
  31.  
  32. // -->
  33. </script>
  34.  
  35.  
  36. <a href="#" onMouseOver="open_new_window()" onMouseOut="close_window()">Open Hover Window</a>
Apr 23 '14 #1
0 1190

Sign in to post your reply or Sign up for a free account.

Similar topics

1
by: chinagirl | last post by:
I have a javascript that displays couple of buttons, which are directional (e.g., click button it goes to a particular page). I need to have these buttons shows up multiple times in same page,...
9
by: james.e.coleman | last post by:
Hello, I have created a custom dropdownlist that is used multiple times within a single page. When trying to set the values of the controls with the page in which they are being used, they all...
7
by: Nathan Sokalski | last post by:
I have user controls that contain a link to a stylesheet. Several of my pages also have a link to this same stylesheet. Because of this, the resulting output contains multiple links to the same...
0
by: Jonathan Duke | last post by:
I have written a custom session state provider that stores session data in XML in a SQL database , and I was running the SQL profiler to verify that all of my stored procedures were called in the...
22
by: Brett Romero | last post by:
If my UI app uses three DLLs and two of those DLLs reference something named utilities.dll, does the UI app load utilities.dll twice or does the compiler recognize what is going on and load...
0
by: Fabuloussites | last post by:
I have a user control that i need to do some processing in a fuction when it is first loaded. I have tried to add my code to the page_load and page_init fuctions. when i run a debugger, i notice...
6
by: yk | last post by:
Hi, Is it a technique available in html/javascript in order to display same image many many times on a same page? Because of a large page loading I am looking for a way not to have same...
9
by: Gummy | last post by:
Hello, I created a user control that has a ListBox and a RadioButtonList (and other stuff). The idea is that I put the user control on the ASPX page multiple times and each user control will...
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: 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?
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
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...

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.