Re: unwanted page reload
- From: Neredbojias <http://www.neredbojias.com/fliam.php?cat=alt.html>
- Date: Thu, 18 May 2006 20:38:01 -0400
To further the education of mankind, "julian_m" <julianmaisano@xxxxxxxxx>
vouchsafed:
After double-clicking the link the browser wants to reload the page,
even though there is not any link at all.
It doesn't happen if I change the "ondblclick" event to "onclick"
<a href="" ondblclick="show_div('the_div_3'); return false;">Div 3</a>
<div style="display: none;" id="the_div_1">This is div 1</div>
The javascript function is really a basic one...
<script type="text/javascript">
function show_div(div_id) {
document.getElementById(div_id).style.display = 'block';
}
</script>
It's 'cause you have an empty href.
Do:
<a href="javascript:void(0)" ondblclick="show_div('the_div_3'); return
false;">
--
Neredbojias
Infinity has its limits.
.
- Follow-Ups:
- Re: unwanted page reload
- From: julian_m
- Re: unwanted page reload
- References:
- unwanted page reload
- From: julian_m
- unwanted page reload
- Prev by Date: Re: Ultra-simple CMS for 1 page
- Next by Date: Re: Ideal HTML code?
- Previous by thread: unwanted page reload
- Next by thread: Re: unwanted page reload
- Index(es):
Relevant Pages
|