A
ace
The said:Why would I ever want to use Jquery?
Don't know about your preferences; I was making a comment on your script.
The said:Why would I ever want to use Jquery?
Doug said:FF 3.0.10 here and when clicking right button[same results in Firefox 3.0.10 and Opera 9.64]
- there is no context menu within gray box
- there is context menu outside gray box
Are you sure that there is a problem with FF?
No, I'm not "sure that there is a problem with FF" -- in fact, I'm pretty sure
there is *not* a problem with Firefox, just a problem with jQuery.
Not sure why it works in your installation and not in mine...
David said:That's the jQuery anthem.
Why did the chicken cross the street?
ECMAScript orthodox church:
Huh?
because it spoted the jQuery on the other side and wanted to smack it.
Doug said:[same results in Firefox 3.0.10 and Opera 9.64]
FF 3.0.10 here and when clicking right button
- there is no context menu within gray box
- there is context menu outside gray box
Are you sure that there is a problem with FF?
No, I'm not "sure that there is a problem with FF" -- in fact, I'm pretty sure
there is *not* a problem with Firefox, just a problem with jQuery.
So if this is jQuery problem as you're suggesting, the proper behavior
for right clicks can be achieved using only plain javascript?
As Laurent pointed out it seems that dom.event.contextmenu is the
answer, so your FF was altered or Mozilla messed up somewhere..?
I posted up someone else's script.ace said:Don't know about your preferences; I was making a comment on your script.
Doug said:I think mine was set to the default value... Anyway, the lesson here is that
the script's behavior is dependent on browser settings that the script cannot
control, and its utility is therefore rather limited.
Oh and while I am in teh mood. lest review this thread in a broader context.The said:Now correct me if I am wrong, but this is the javascript group, right?
Ergo, any code that we write that is intended to be executed by a
javascript interpreter in a browser is, in fact totally subject to the
browser having the magic box 'allow javascript' ticked, right?
So, with respect, what the **** has whether something can be switched
off in a browser got to do with anything . It ALL can be switched off in
a browser.
Now correct me if I am wrong, but this is the javascript group, right?
Ergo, any code that we write that is intended to be executed by a
javascript interpreter in a browser is, in fact totally subject to the
browser having the magic box 'allow javascript' ticked, right?
So, with respect, what the **** has whether something can be switched
off in a browser got to do with anything . It ALL can be switched off in
a browser.
The Natural Philosopher said:Title says it all.
I would like to intercept the right mouse click and have it do
something other than what it does by default within a browser context.
Also to make it context sensitive (of course)
The said:So, its pure horseshit, you can find time to say so, but not why.David said:Doug Miller wrote:
http://abeautifulsite.net/notebook_files/68/demo/
Does not work as advertised: the behavior of the right mouse button
inside the
box labelled "No context menu in this container" is identical in
all respects
with its behavior *outside* that box.
[same results in Firefox 3.0.10 and Opera 9.64]
Does work as advertised in IE 7.0.6001, though...
Imagine my surprise -- a JQuery app that works in IE and is broken
in other
browsers. What a shock.
Yep. And I don't call jquery 'simple'
I found this on the net:-
<a href="javascript:void(null)"
onmousedown="return buttonalert(event)" onmouseup="return
dont(event)"
onclick="return dont(event)" ondblclick="return dont(event)"
oncontextmenu="return dont(event)"
Click here with various mouse buttons to test</a>
</center>
<script language="Javascript">
function buttonalert(event)
{
var button;
if (event.which == null)
button= (event.button < 2) ? "LEFT" :
((event.button == 4) ? "MIDDLE" : "RIGHT");
else
button= (event.which < 2) ? "LEFT" :
((event.which == 2) ? "MIDDLE" : "RIGHT");
alert(button);
dont(event);}
function dont(event)
{
if (event.preventDefault)
event.preventDefault();
else
event.returnValue= false;
return false;}
</script>
It seems to work pretty well and covers most bases.
Anyone care to comment on it?
Yes, like most snippets you find on the Web, it's pure horseshit.
Look again.
Conrad said:If this is for an intranet app, then what's the big problem? You've got
the code that works with one specific setup, and you can enforce that
setup. Problem solved, you can move on to the next task. You can't
expect people to know that "the thing you're working on" isn't intended
for a normal website.
Garrett said:The said:So, its pure horseshit, you can find time to say so, but not why.David said:On May 22, 10:41 am, The Natural Philosopher <[email protected]>
wrote:
Doug Miller wrote:
http://abeautifulsite.net/notebook_files/68/demo/
Does not work as advertised: the behavior of the right mouse
button inside the
box labelled "No context menu in this container" is identical in
all respects
with its behavior *outside* that box.
[same results in Firefox 3.0.10 and Opera 9.64]
Does work as advertised in IE 7.0.6001, though...
Imagine my surprise -- a JQuery app that works in IE and is broken
in other
browsers. What a shock.
Yep. And I don't call jquery 'simple'
I found this on the net:-
<a href="javascript:void(null)"
onmousedown="return buttonalert(event)" onmouseup="return
dont(event)"
onclick="return dont(event)" ondblclick="return dont(event)"
oncontextmenu="return dont(event)"
Click here with various mouse buttons to test</a>
</center>
<script language="Javascript">
function buttonalert(event)
{
var button;
if (event.which == null)
button= (event.button < 2) ? "LEFT" :
((event.button == 4) ? "MIDDLE" : "RIGHT");
else
button= (event.which < 2) ? "LEFT" :
((event.which == 2) ? "MIDDLE" : "RIGHT");
alert(button);
dont(event);}
function dont(event)
{
if (event.preventDefault)
event.preventDefault();
else
event.returnValue= false;
return false;}
</script>
It seems to work pretty well and covers most bases.
Anyone care to comment on it?
Yes, like most snippets you find on the Web, it's pure horseshit.
Look again.
The problems are partiallay explained in two parts of the FAQ:
http://jibbering.com/faq/#javascriptURI
The well-documented problems that exist with javascript pseudo protocol
not stop people from using it. Look at Google Maps, for example.
The archives includes discussion about "disabling the right mouse
button" and why the question itself is flawed. I don't have a mouse, and
if I did, your code cannot affect it. It can, in some browsers, affect
the context menu.
Why do they always assume it is?
And the same applies: There is so much configurability in a browser,
that frankly, javascript becomes totally irrelevant if you want to code
to 'lowest common factor' standards..
And what is a 'normal website' anyway?
RobG said:Perhaps the FAQ has the answer:
| 1.2 What questions are on-topic for comp.lang.javascript?
|
| The comp.lang.javascript newsgroup deals with ECMAScript
| languages, so any questions about JavaScript or JScript
| are welcome. However, the majority of questions sent to
| this group relates to javascript in a web browser. If you
| are experiencing issues with a particular browser, or the
| host is not a browser at all, please make this information
| clear.
Which infers that if you aren't asking about web browsers in general
as used on the WWW (which covers the majority of questions here), then
it helps if you say so.
That is again a moot point. What is 'on the www'?Not at all. There are well known techniques for making web sites
widely accessible, they don't preclude the use of javascript.
One on the WWW perhaps.
Of course I was talking about web BRIOSWERS as used on..etc.
The question was what SITES. Not what BROWSERS.
That is again a moot point. What is 'on the www'?
My test site here is 'on the www' and accessible by anyone who knows the
right magic spells.
Fortunately almost no one does.
The real issue is the target audience you are designing for, and whether
or not you actually care whether a deaf dumb and blind idiot running a
braille keyboard and lynx on OS/2 over a 300 baud modem to a braille
output device is truly someone you want or need to make your site
accessible to..
In reality 99.99% of your target market COULD run firefox, as there is
probably only a handful of platforms it hasn't been ported to, and the
vast majority will be running IE6,7 or 8..with a smattering of safari
mac users..and a few people on other odd browsers for use on mobile
phones and the like.
Conrad said:"Altered" is not the right word. It's not a hidden preference - it's
right there on the Preferences -> Content tab. Since such an option
exists, the script has to deal with the fact that the context menu event
and "right" mouse button events can't be trusted, and you'll have to
find another way to show your own context menu.
BTW... "ECMAScript orthodox church"? Nice one
Doug said:[same results in Firefox 3.0.10 and Opera 9.64]
FF 3.0.10 here and when clicking right button
- there is no context menu within gray box
- there is context menu outside gray box
Are you sure that there is a problem with FF?
No, I'm not "sure that there is a problem with FF" -- in fact, I'm pretty sure
So if this is jQuery problem as you're suggesting, the proper behavior
for right clicks can be achieved using only plain javascript?
Total non sequitur. What did I say that comes even remotely close to
suggesting that?
I think mine was set to the default value... Anyway, the lesson here is that
the script's behavior is dependent on browser settings that the script cannot
control, and its utility is therefore rather limited.
David said:Chickens don't like jQuery either?
Doug said:[same results in Firefox 3.0.10 and Opera 9.64]
FF 3.0.10 here and when clicking right button
- there is no context menu within gray box
- there is context menu outside gray box
Are you sure that there is a problem with FF?
No, I'm not "sure that there is a problem with FF" -- in fact, I'm pretty
sure
there is *not* a problem with Firefox, just a problem with jQuery.
So if this is jQuery problem as you're suggesting, the proper behavior
for right clicks can be achieved using only plain javascript?Total non sequitur. What did I say that comes even remotely close to
suggesting that?
You wrote that there is problem with jQuery, so I wondered if problem
could be avoided by dropping it and using only native js.
I think mine was set to the default value... Anyway, the lesson here isthat
the script's behavior is dependent on browser settings that the script cannot
control, and its utility is therefore rather limited.
yep, but we could also blame it on the jquery which is pretty popular
here on the newsgroup.
Want to reply to this thread or ask your own question?
You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.