llizard
04-27-2004, 06:40 PM
I have a page with several links to open in the same popup window. This is the coding I am using:
<a href="URL_1" title="link name 1"
onclick="var w=window.open('URL_1', 'popup', 'scrollbars=1,resizable=1,width=590,height=400,left=20,top=20'); return false;"
onmouseover="setAttribute('title',' "link 1" opens in a popup')">link 1</a>
<a href="URL_2" title="link name 2"
onclick="var w=window.open('URL_2', 'popup', 'scrollbars=1,resizable=1,width=590,height=400,left=20,top=20'); return false;"
onmouseover="setAttribute('title',' "link 2" opens in a popup')">link 2</a>
<a href="URL_3" etc.etc.
I am a rank beginner at javascripting and wonder how to go about putting most of the popup coding into the header so that I am not repeating the same rather large amount of code over and over in each link.
<script type="text/javascript">
<!--
???
// -->
</script>
</head>
<body>
<a href="URL_1" title="link name 1"
onclick="var w=window.open('URL_1', 'a var???'); return false;"
onmouseover="setAttribute('title','"link 1" a var???')">link 1</a>
<a href="URL_2" title="link name 2"
onclick="var w=window.open('URL_2', a var???); return false;"
onmouseover="setAttribute('title',' "link 2" a var???')">link 2</a>
Even better would be if any repeated onclick and onmouseover stuff could be in the header. Thank you for any help you can offer.
<a href="URL_1" title="link name 1"
onclick="var w=window.open('URL_1', 'popup', 'scrollbars=1,resizable=1,width=590,height=400,left=20,top=20'); return false;"
onmouseover="setAttribute('title',' "link 1" opens in a popup')">link 1</a>
<a href="URL_2" title="link name 2"
onclick="var w=window.open('URL_2', 'popup', 'scrollbars=1,resizable=1,width=590,height=400,left=20,top=20'); return false;"
onmouseover="setAttribute('title',' "link 2" opens in a popup')">link 2</a>
<a href="URL_3" etc.etc.
I am a rank beginner at javascripting and wonder how to go about putting most of the popup coding into the header so that I am not repeating the same rather large amount of code over and over in each link.
<script type="text/javascript">
<!--
???
// -->
</script>
</head>
<body>
<a href="URL_1" title="link name 1"
onclick="var w=window.open('URL_1', 'a var???'); return false;"
onmouseover="setAttribute('title','"link 1" a var???')">link 1</a>
<a href="URL_2" title="link name 2"
onclick="var w=window.open('URL_2', a var???); return false;"
onmouseover="setAttribute('title',' "link 2" a var???')">link 2</a>
Even better would be if any repeated onclick and onmouseover stuff could be in the header. Thank you for any help you can offer.