Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > HTML > unwanted page reload

Reply
Thread Tools

unwanted page reload

 
 
julian_m
Guest
Posts: n/a
 
      05-18-2006
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>


Any hint?

regards- julian

 
Reply With Quote
 
 
 
 
Neredbojias
Guest
Posts: n/a
 
      05-19-2006
To further the education of mankind, "julian_m" <(E-Mail Removed)>
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.
 
Reply With Quote
 
 
 
 
julian_m
Guest
Posts: n/a
 
      05-19-2006

Neredbojias wrote:
> To further the education of mankind, "julian_m" <(E-Mail Removed)>
> 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;">
>

Great, thanks.

It's strange what happens with (click != dblclick) though

regards - julian

 
Reply With Quote
 
Neredbojias
Guest
Posts: n/a
 
      05-19-2006
To further the education of mankind, "julian_m"
<(E-Mail Removed)> vouchsafed:

>> > After double-clicking the link the browser wants to reload the
>> > page, even though there is not any link at all.


>> It's 'cause you have an empty href.
>>
>> Do:
>>
>> <a href="javascript:void(0)" ondblclick="show_div('the_div_3');
>> return false;">


> Great, thanks.
>
> It's strange what happens with (click != dblclick) though


The href picks up the click before the double-click, and when empty reacts
in browser-specific ways.

--
Neredbojias
Infinity has its limits.
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
using refresh to reload page, problem is it loads header, footer andeverything, can I avoind those to reload? VT HTML 8 10-13-2010 11:09 PM
JavaScript refresh: <a href="#" onClick="window.location.reload( true );">Reload</a> Joshua Beall HTML 26 06-29-2007 06:31 PM
Unwanted frame refresh/reload... Blue Streak HTML 3 06-07-2006 02:33 PM
problem with reload(sys) (doing reload on the sys module) gen_tricomi Python 2 05-23-2006 10:03 AM
Is there an SNMP equivalent to "Reload in [x]" / "Reload cancel" commands? steve.chambers@gmail.com Cisco 5 05-20-2006 04:06 AM



Advertisments