473,544 Members | 1,967 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

how to implement oncontextmenu=" return false;" to pass the W3C parser ?

me
I have got all my pages to comply with the W3C validator, except this
one line as below.

I need to keep the line (or the functionalilty) but it would be nice
to implement it in a way that gives me a 100% pass with W3C.

Any ideas?

Thanks.
Line 45, column 33: there is no attribute "ONCONTEXTM ENU"

<body class="body" oncontextmenu=" return false;">

You have used the attribute named above in your document, but the
document type you are using does not support that attribute for this
element. This error is often caused by incorrect use of the "Strict"
document type with a document that uses frames (e.g. you must use the
"Transition al" document type to get the "target" attribute), or by
using vendor proprietary extensions such as "marginheig ht" (this is
usually fixed by using CSS to achieve the desired effect instead).

This error may also result if the element itself is not supported in
the document type you are using, as an undefined element will have no
supported attributes; in this case, see the element-undefined error
message for further information.

How to fix: check the spelling and case of the element and attribute,
(Remember XHTML is all lower-case) and/or check that they are both
allowed in the chosen document type, and/or use CSS instead of this
attribute.
Jul 23 '05 #1
11 43946
In comp.infosystem s.www.authoring.html me said:
I have got all my pages


i know

What is the accepted way to share a message across multiple newsgroups?
http://smjg.port5.com/faqs/usenet/xpost.html

--
t h e o f l i t t l e v o i c e s
Jul 23 '05 #2
rf
me wrote:
I have got all my pages to comply with the W3C validator, except this
one line as below.


Why do you want to cripple my browser so I can't use the context menu to,
for instance, bookmark your site?

You don't by any change think that this tomfoolery will prevent me from
stealing your precious HTML do you?

--
Cheers
Richard.
Jul 23 '05 #3
me wrote:
I have got all my pages to comply with the W3C validator, except this
one line as below.

I need to keep the line (or the functionalilty) but it would be nice
to implement it in a way that gives me a 100% pass with W3C. <body class="body" oncontextmenu=" return false;">


Use Javascript's addEventListene r function to attach the event to the
body element.

--
Mark.
http://tranchant.plus.com/
Jul 23 '05 #4
me wrote:
I have got all my pages to comply with the W3C validator, except this
one line as below.

I need to keep the line (or the functionalilty) but it would be nice
to implement it in a way that gives me a 100% pass with W3C.


....but disabling the context menu is stupid.

--
Mark.
http://tranchant.plus.com/
Jul 23 '05 #5
me <me@no.where.co m> wrote:
I have got all my pages to comply with the W3C validator, except this
one line as below.

I need to keep the line (or the functionalilty) but it would be nice
to implement it in a way that gives me a 100% pass with W3C.

Any ideas?

Thanks.
Line 45, column 33: there is no attribute "ONCONTEXTM ENU"

<body class="body" oncontextmenu=" return false;">


This is a Microsoft IE extension. There is no mechanism in the
standards for intercepting the opening of a context menu. Therefore,
there is no way to do so that will pass the validator.

If you feel you must be able to disable your users' context menus,
then you're in trouble because you can only do that to IE users. Users
of other browsers will be able to access their context menus just
fine.

--
Harlan Messinger
Remove the first dot from my e-mail address.
Veuillez ôter le premier point de mon adresse de courriel.
Jul 23 '05 #6

"Mark Tranchant" <ma**@tranchant .plus.com> wrote in message
news:41******** *************** @ptn-nntp-reader02.plus.n et...
me wrote:
I have got all my pages to comply with the W3C validator, except this
one line as below.

I need to keep the line (or the functionalilty) but it would be nice
to implement it in a way that gives me a 100% pass with W3C.

<body class="body" oncontextmenu=" return false;">


Use Javascript's addEventListene r function to attach the event to the
body element.


Is that a Javascript function? IE doesn't have it. It does have
attachEvent--but the IE documentation indicates that *that* is non-standard.
Yeah, the OP will get by the validator--but outside of IE he still won't get
what he wants.

Jul 23 '05 #7
On Mon, 01 Nov 2004 12:08:43 +0000, me <me@no.where.co m> wrote:
I have got all my pages to comply with the W3C validator, except this
one line as below.


Don't use a Strict DTD unless you understand every error report from a
validator.

If you do, and you don't, then try revalidating it with a Transitional
DTD.

If it still won't validate, then take out the non-standard HTML
extensions that you're using, despite the very clear and obvious error
report you've been given.

And _NEVER_ turn off the whole context menu. That kills image
reloading, printing, and a whole pile of useful things as well as
whatever it was you thought you were doing. If you're paranoid about
content theft, then you need to be better about it; more secure, and
less irritating.

--
Smert' spamionam
Jul 23 '05 #8
On Mon, 1 Nov 2004 09:59:17 -0500, Harlan Messinger
<h.*********@co mcast.net> wrote:
"Mark Tranchant" <ma**@tranchant .plus.com> wrote in message
news:41******** *************** @ptn-nntp-reader02.plus.n et...
[snip]
Use Javascript's addEventListene r function to attach the event to the
body element.


Is that a Javascript function?


Yes and no. It's a method exposed to ECMAScript implementations , but it's
defined by the W3C in DOM 2 Events.
IE doesn't have it.
No, as IE doesn't implement the Events module.
It does have attachEvent
A rather annoying thing to use. In event listeners added through HTML, the
on<event> properties of the element, or addEventListene r in conforming
browsers, the this operator refers to the current target of the event.

Though that's fine in IE, event listeners added through attachEvent do not
have a correctly set this operator. In fact, it refers the global object
(window).

[snip]
Yeah, the OP will get by the validator--but outside of IE he still won't
getwhat he wants.


document.oncont extmenu = function() {return false;};

Depending on your point of view, that will, or will not, still produce an
invalid document tree, but it will pass the validator. I don't condone it
in either case, by the way.

Mike

--
Michael Winter
Replace ".invalid" with ".uk" to reply by e-mail.
Jul 23 '05 #9
On Mon, 01 Nov 2004 15:01:34 +0000, Andy Dingley <di*****@codesm iths.com>
wrote:
On Mon, 01 Nov 2004 12:08:43 +0000, me <me@no.where.co m> wrote:
I have got all my pages to comply with the W3C validator, except this
one line as below.


Don't use a Strict DTD unless you understand every error report from a
validator.


How else can you learn every error report?
Jul 23 '05 #10

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

8
2325
by: Arvid Andersson | last post by:
Hello, I need to convert a string to a number, but the string can contain +,-,* and / as well as parenthesis. For example, if I have the string "30/(6+9)" I would like a function that returned the number 2. I actually wrote a java function that did this a couple of years ago, in school, as an excersise in "binary trees". I lost it, and most...
1
3909
by: ItsMillerTime4u | last post by:
I'm trying to change the <body> 's event oncontextmenu attributes, but am having no luck at it. I know I can do <body oncontextmenu="contextMenu(); return false;"> but the thing is that I set's this attribute as soon as the page loads......which I don't to happen....I don't want to the context menu visible until the page is done loading,...
8
2447
by: Ken Yu | last post by:
Hi, How can i disable "RightClick Menu" in Internet Explorer, when access the frontpage ? tks a lot ! Ken
15
5264
by: Cruella DeVille | last post by:
I'm trying to implement a bookmark-url program, which accepts user input and puts the strings in a dictionary. Somehow I'm not able to iterate myDictionary of type Dict{} When I write print type(myDictionary) I get that the type is "instance", which makes no sense to me. What does that mean? Thanks
40
3093
by: Mark P | last post by:
I'm implementing an algorithm and the computational flow is a somewhat deep. That is, fcn A makes many calls to fcn B which makes many calls to fcn C, and so on. The return value of the outermost fcn is a boolean and there are certain places within the inner functions where it may become apparent that the return value is false. In this case...
37
3901
by: jht5945 | last post by:
For example I wrote a function: function Func() { // do something } we can call it like: var obj = new Func(); // call it as a constructor or var result = Func(); // call it as a function
4
9124
by: Luc The Perverse | last post by:
Hi - I have very little C# programming experience. I am making a software product which calls for an interface almost identical to Windows Explorer - and I wondered if mounting a "virtual drive" would be feasable for me (someone not good at programming) to implement. -- LTP :)
3
1749
by: Mark Shroyer | last post by:
I guess this sort of falls under the "shameless plug" category, but here it is: Recently I used a custom metaclass in a Python program I've been working on, and I ended up doing a sort of write-up on it, as an example of what a "real life" __metaclass__ might do for those who may never have seen such a thing themselves. ...
29
2397
by: Java script Dude | last post by:
Greetings, Now I can understand that 0 equal false, but should "" also equal false? Apparently the answer is yes. When I test both Firefox and IE, they both say ""==false . I assume this goes back to the original spec for JavaScript. Not very intuitive but I guess I can code around this.
0
7452
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
0
7387
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language...
0
7798
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
0
7738
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
1
5316
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
0
4938
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
0
3441
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
1
1862
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
0
688
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.