Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Button Link Problem

Status
Not open for further replies.

Masada

Technical User
May 30, 2001
2
AU
I am having troubling understanding buttons which can be used as links. I have included my HTML page (with the scripts) underneath. The problem is that they work 100% fine in Netscape, but Internet Explorer seems to REFRESH itself whenever these buttons are pressed.

******************************

<html>
<head>
<title>My page</title>

<script language=&quot;javascript&quot;>

<!-- Begin
<!-- Links Button to News Page -->
function goToURLNews() { window.location = &quot;news.html&quot;; }
<!-- End Button Link -->

<!-- Links Button to Wu-Albums Page -->
function goToURLAlbums() { window.location = &quot;albums/index.html&quot;; }
<!-- End Button Link -->

<!-- Links Button to Prerelease Page -->
function goToURLPrerelease() { window.location = &quot;prerelease/index.html&quot;; }
<!-- End Button Link -->

<!-- Links Button to RDates Page -->
function goToURLRDates() { window.location = &quot;other/releasedates.html&quot;; }
<!-- End Button Link -->

<!-- Links Button to Wu-Fam Page -->
function goToURLWufam() { window.location = &quot;wufam/index.html&quot;; }
<!-- End Button Link -->

<!-- Links Button to Cameos & B-Sides Page -->
function goToURLCameos() { window.location = &quot;other/cameos.html&quot;; }
<!-- End Button Link -->

<!-- Links Button to Image Gallery Page -->
function goToURLgallery() { window.location = &quot;imagegallery/imagegallery.html&quot;; }
<!-- End Button Link -->

<!-- Links Button to Links Page -->
function goToURLLink() { window.location = &quot;other/links.html&quot;; }
<!-- End Button Link -->
// End -->

<!-- Digital Clock Section -->
<!-- Begin
var dn;
c1 = new Image(); c1.src = &quot;digital-clock/c1.gif&quot;;
c2 = new Image(); c2.src = &quot;digital-clock/c2.gif&quot;;
c3 = new Image(); c3.src = &quot;digital-clock/c3.gif&quot;;
c4 = new Image(); c4.src = &quot;digital-clock/c4.gif&quot;;
c5 = new Image(); c5.src = &quot;digital-clock/c5.gif&quot;;
c6 = new Image(); c6.src = &quot;digital-clock/c6.gif&quot;;
c7 = new Image(); c7.src = &quot;digital-clock/c7.gif&quot;;
c8 = new Image(); c8.src = &quot;digital-clock/c8.gif&quot;;
c9 = new Image(); c9.src = &quot;digital-clock/c9.gif&quot;;
c0 = new Image(); c0.src = &quot;digital-clock/c0.gif&quot;;
cb = new Image(); cb.src = &quot;digital-clock/cb.gif&quot;;
cam = new Image(); cam.src = &quot;digital-clock/cam.gif&quot;;
cpm = new Image(); cpm.src = &quot;digital-clock/cpm.gif&quot;;
function extract(h,m,s,type) {
if (!document.images) return;
if (h <= 9) {
document.images.a.src = cb.src;
document.images.b.src = eval(&quot;c&quot;+h+&quot;.src&quot;);
}
else {
document.images.a.src = eval(&quot;c&quot;+Math.floor(h/10)+&quot;.src&quot;);
document.images.b.src = eval(&quot;c&quot;+(h%10)+&quot;.src&quot;);
}
if (m <= 9) {
document.images.d.src = c0.src;
document.images.e.src = eval(&quot;c&quot;+m+&quot;.src&quot;);
}
else {
document.images.d.src = eval(&quot;c&quot;+Math.floor(m/10)+&quot;.src&quot;);
document.images.e.src = eval(&quot;c&quot;+(m%10)+&quot;.src&quot;);
}
if (s <= 9) {
document.g.src = c0.src;
document.images.h.src = eval(&quot;c&quot;+s+&quot;.src&quot;);
}
else {
document.images.g.src = eval(&quot;c&quot;+Math.floor(s/10)+&quot;.src&quot;);
document.images.h.src = eval(&quot;c&quot;+(s%10)+&quot;.src&quot;);
}
if (dn == &quot;AM&quot;) document.j.src = cam.src;
else document.images.j.src = cpm.src;
}
function show3() {
if (!document.images)
return;
var Digital = new Date();
var hours = Digital.getHours();
var minutes = Digital.getMinutes();
var seconds = Digital.getSeconds();
dn = &quot;AM&quot;;
if ((hours >= 12) && (minutes >= 1) || (hours >= 13)) {
dn = &quot;PM&quot;;
hours = hours-12;
}
if (hours == 0)
hours = 12;
extract(hours, minutes, seconds, dn);
setTimeout(&quot;show3()&quot;, 1000);
}
// End -->
<!-- End Digital Clock Section -->

</script>
</head>

<BODY onLoad=&quot;show3()&quot; bgcolor=&quot;#000000&quot;>
<body background=&quot;pics/background01-1024-768.gif&quot; TEXT=&quot;#FFFFFF&quot; LINK=&quot;#0000FF&quot; VLINK=&quot;#0000FF&quot;>

<TABLE ALIGN=center><FORM>
<A HREF=&quot; TARGET=_blank><IMG SRC=&quot;pics\cdnow.gif&quot; WIDTH=&quot;126&quot; HEIGHT=&quot;40&quot; BORDER=&quot;0&quot; ALT=&quot;CDNow&quot;></A>
 <A TARGET=&quot;_blank&quot; HREF=&quot; SRC=&quot;pics\wuwearbanner.gif&quot; border=0 width=468 height=60 alt=&quot;Wu-Wear Store&quot;></A>
<img src=&quot;digital-clock/cb.gif&quot; name=a>
<img src=&quot;digital-clock/cb.gif&quot; name=b>
<img src=&quot;digital-clock/colon.gif&quot; name=c>
<img src=&quot;digital-clock/cb.gif&quot; name=d>
<img src=&quot;digital-clock/cb.gif&quot; name=e>
<img src=&quot;digital-clock/colon.gif&quot; name=f>
<img src=&quot;digital-clock/cb.gif&quot; name=g>
<img src=&quot;digital-clock/cb.gif&quot; name=h>
<img src=&quot;digital-clock/cam.gif&quot; name=j>

</FORM></TABLE>

<!-- Top Buttons used on Page -->
<TABLE ALIGN=center><FORM>
<font face=&quot;arial&quot; size=&quot;1&quot; color=&quot;#FFFFFF&quot;> <p align=&quot;center&quot;>
<INPUT TYPE=&quot;submit&quot; value=&quot;News&quot; onClick=&quot;goToURLNews()&quot;>
<INPUT TYPE=&quot;submit&quot; value=&quot;Wu-Albums&quot; onClick=&quot;goToURLAlbums()&quot;>
<INPUT TYPE=&quot;submit&quot; value=&quot;Pre-Release Info&quot; onClick=&quot;goToURLPrerelease()&quot;>
<INPUT TYPE=&quot;submit&quot; value=&quot;Release Dates&quot; onClick=&quot;goToURLRDates()&quot;>
</FORM></TABLE>
<!-- End Buttons -->

<TABLE ALIGN=center>
<IMG SRC=&quot;pics\logosmall.jpg&quot; BORDER=0 alt=&quot;Welcome to the Wu-Tang Monastery: WTM Resurrection&quot;><P>
</TABLE>

<!-- Bottom Buttons used on Page -->
<TABLE ALIGN=center><FORM>
<font face=&quot;arial&quot; size=&quot;1&quot; color=&quot;#FFFFFF&quot;> <p align=&quot;center&quot;>
<INPUT TYPE=&quot;submit&quot; value=&quot;Wu-Fam&quot; onClick=&quot;goToURLWufam()&quot;>
<INPUT TYPE=&quot;submit&quot; value=&quot;Cameos & B-Sides&quot; onClick=&quot;goToURLCameos()&quot;>
<INPUT TYPE=&quot;submit&quot; value=&quot;Image Gallery&quot; onClick=&quot;goToURLgallery()&quot;>
<INPUT TYPE=&quot;submit&quot; value=&quot;Links&quot; onClick=&quot;goToURLLink()&quot;>
</FORM></TABLE>
<!-- End Buttons -->

<TABLE ALIGN=center><FORM>
<INPUT TYPE=&quot;submit&quot; VALUE=&quot;E-Mail&quot; onClick=&quot;parent.location='mailto:wubloodkin@apexmail.com?subject=Wu-Tang'&quot;>
</TABLE></FORM>

<TABLE ALIGN=center>
<!-- Note -->
<font face=&quot;arial&quot; size=&quot;1&quot; color=&quot;#FFFFFF&quot;>
<a href=&quot;siteinfo.html&quot; ONMOUSEOVER=&quot;window.status='Click here for information about this website';return true&quot;>Site Info</a> * <a href=&quot; ONMOUSEOVER=&quot;window.status='Sign the Guestbook';return true&quot;>Guestbook</a> * <a href=&quot;other/disclaimer.html&quot; ONMOUSEOVER=&quot;window.status='Click here for disclaimer information';return true&quot;>Disclaimer</a>
</font>
<!-- End Note -->
</TABLE><P>

<!-- Note2 -->
<TABLE ALIGN=center>
<font face=&quot;arial&quot; size=&quot;1&quot; color=&quot;#FFFFFF&quot;>
© 1998 - 2001<BR>
</TABLE>
<TABLE ALIGN=center>
Props to Skeptah for designing the original site logo.
</font>
</TABLE>
<!-- End Note2 -->

</body>
</html>
 
Hi Masada,

It's just because you must use button in put and not submit input:

<INPUT TYPE=&quot;button&quot; value=&quot;Image Gallery&quot; onClick=&quot;goToURLgallery()&quot;>
instead of:
<INPUT TYPE=&quot;submit&quot; value=&quot;Image Gallery&quot; onClick=&quot;goToURLgallery()&quot;>

I think that it will solve your problem.

Hope this helps...
SeAL
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top