FireFox Click Wheel does not fire onclick Event
I just noticed something today in Firefox (on Windows, probably the same on Mac haven't tested yet). Suppose you have a link with a JavaScirpt onclick event such as:
<a href="deleteTB.cfm" onclick="javascript:return confirm('Are you sure?');">delete</a>
If you click this link with the left mouse button the JavaScript is executed. If you click with the scroll wheel the event is not fired. This is a fairly common thing for a FireFox user to do since you can open links in new tabs by clicking on links with the scroll wheel.
Related Entries
- Ajax Same Origin Policy No More with Firefox 3.5 - June 30, 2009
- Geolocation API for Adobe AIR? - October 8, 2008
- AJAX on IE - back to the IFRAME - August 17, 2005
- GreaseMonkey User Scripts - May 11, 2005
- Venkman JavaScript Debugger Firefox Extension - December 29, 2004
Trackbacks
Trackback Address: 565/0AB732EC566EB2EAFB1C6262DFBAADA1
Comments
On 05/08/2006 at 4:09:37 PM EDT Jason Grunstra wrote:
1
I think this is a good thing! I use it all the time to bypass JavaScript confirmation dialogs.
On 05/08/2006 at 9:41:08 PM EDT Pete Freitag wrote:
2
Bug or feature? You decide :)
On 05/09/2006 at 7:25:26 AM EDT Brandon Eley wrote:
3
I think it's a feature. If you wanted to execute the JS you could right-click and choose "Open in a new tab" instead of middle-clicking.
On 05/11/2006 at 3:50:18 PM EDT Bryan Ashcraft wrote:
4
You could also use Ctrl+Left-Click to open the link in a new teb. At least in Windows.
On 05/12/2006 at 11:53:41 AM EDT gaby de wildw wrote:
5
It's the way it should be, The js can-not be opened in a new page. A web designer needs to create an alternative way of accessing the site without js. That why the href should always be there.
Middle click should open a new tab. In case there is no real link the js can't open in a new page anyway. Sites that do open the js as if it's an url are just coded badly.
<a href="javascript:popup()">like this</a>
I do agree, it would be more logical for a browser to support onmiddleclick= and target="new_tab"
On 06/19/2006 at 4:43:42 AM EDT tom wrote:
6
onmouseup is triggered by middle click though...
On 07/21/2006 at 8:34:45 AM EDT scuba steve wrote:
7
i dislike the js confirmations also, but sometimes a legal disclaimer is needed (for the customer) when opening an external link. onmouse up works but displays the link in the newtab with or without confirmation?
On 11/24/2007 at 1:50:27 PM EST Calvin Spealman wrote:
8
I am looking for a way around this because I have my button behavior reversed so that left-click opens tabs (my default) and middle click keeps me in the same page. When I use a web app that has a mix of plain and javascript links, I have to learn which are which so I know how to navigate properly. Annoying, but surprisingly learnable. Still, I would love to get the javascript triggered on middle click if I have this behavior setup. (I use Tab Mix Plus for this)
Post a Comment
Recent Entries
- Cache Template in Request Setting Explained
- What Version of Java is ColdFusion Using?
- ColdFusion 9 Performance Brief from Adobe
- Request Filtering in IIS 7 Howto
- J2EE Session Cookies on ColdFusion / JRun
- Hands on ColdFusion Security Training
- ColdFusion 9 Solr Vulnerability - Are you at Risk?
- FCKEditor Year 2010 Bug for Firefox 3.6 with ColdFusion
Middle click should open a new tab. In case there is no real link the js can't open in a new page anyway. Sites that do open the js as if it's an url are just coded badly.
<a href="javascript:popup()">like this</a>
I do agree, it would be more logical for a browser to support onmiddleclick= and target="new_tab"



add to del.icio.us



