467,886 Members | 1,807 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 467,886 developers. It's quick & easy.

Removes default drag behaviour on image in Netscape

I am trying to implement a rubber band/image selection script. For
that I need to remove the default drag behaviour on an image. I am
able to do this in IE but not Netscape. Does any one have a solution?

Pls look below for IE code:

var moz = ((document.all)? false : true);
var ie = ((document.all)? true : false);
var ElementUtil = new Object();
ElementUtil.addEventListener = function(o, type, handler) {
if(ie) {
o.attachEvent("on" + type, handler);
}
else if(moz) {
o.addEventListener(type, handler, false);
}
}

// Removes default drag behaviour on image in ie
ElementUtil.addEventListener(img, "drag", function() {return false;});

Thanks in advance
Kiran Makam
Jul 23 '05 #1
  • viewed: 1346
Share:
11 Replies


kiran wrote:
I am trying to implement a rubber band/image selection script. For
that I need to remove the default drag behaviour on an image. I am
able to do this in IE but not Netscape.


<img onmousedown="if (event.preventDefault) {
event.preventDefault();
}
return false;"

--

Martin Honnen
http://JavaScript.FAQTs.com/
Jul 23 '05 #2
Martin Honnen <ma*******@yahoo.de> wrote in message news:<41**********************@newsread2.arcor-online.net>...

<img onmousedown="if (event.preventDefault) {
event.preventDefault();
}
return false;"

Thanks Martin, this is exactly what I was looking for. Is there any
website where we can refer Netscape's object model (properties,
methods, events...)?

Kiran Makam
Jul 23 '05 #3
kiran wrote:
[...] Is there any website where we can refer Netscape's object
model (properties, methods, events...)?


That depends on what you mean by Netscape. For Gecko-based UAs like
Netscape 6+, see

<http://mozilla.org/docs/dom/domref/>
<http://xulplanet.com/references/objref/>

For all Netscape versions and Gecko-based UAs (i.e. for DOM Level 0),
see

<http://web.archive.org/web/20031202201701/devedge.netscape.com/central/javascript/>

For general information see

<http://pointedears.de/ObjectInspector>
PointedEars
--
You know that feeling when you're leaning back in a chair, and you're
Jul 23 '05 #4
In response to a message dated 2004 October 5, Thomas 'PointedEars' Lahn
wrote on 2004 October 24, a full 20 days after the thread had ended:
kiran wrote:

[...] Is there any website where we can refer Netscape's object
model (properties, methods, events...)?

That depends on what you mean by Netscape.


Common sense alone indicates he means, ummm, Netscape.

For Gecko-based UAs like Netscape 6+, see

<http://mozilla.org/docs/dom/domref/>
<http://xulplanet.com/references/objref/>

For all Netscape versions and Gecko-based UAs (i.e. for DOM Level 0),
see

<http://web.archive.org/web/20031202201701/devedge.netscape.com/central/javascript/>
Ummm, no. I don't see anything about Javascript 1.2 so it *cant*
possibly be "all Netscape versions".
For general information see

<http://pointedears.de/ObjectInspector>


I prefer this URL to it:

http://www.stud.tu-ilmenau.de/~thla-...y/latest/index

Instead of masked pages where they attempt to hide the URL to the page.

But either way, its broken. I will leave it as an exercise to you, to
discover the flaw I found in it.

--
Randy
comp.lang.javascript FAQ - http://jibbering.com/faq
Jul 23 '05 #5
JRS: In article <FI********************@comcast.com>, dated Sun, 24 Oct
2004 10:00:22, seen in news:comp.lang.javascript, Randy Webb
<Hi************@aol.com> posted :
In response to a message dated 2004 October 5, Thomas 'PointedEars' Lahn
wrote on 2004 October 24, a full 20 days after the thread had ended:
kiran wrote:

Tank Engine is possibly unaware of Usefor Work-In-Progress <URL:
http://www.ietf.org/internet-drafts/draft-ietf-usefor-useage-00.txt>
(CHL, May 2004) :-

3.2.2.1. Quoting and Attributions
....
The followup agent SHOULD also precede the quoted content by an
"attribution line" (however, readers are warned not to assume that
they are accurate, especially within multiply nested quotations). The
following convention for such lines is intended to facilitate their
automatic recognition and processing by sophisticated reading agents.
The attribution SHOULD contain the name and/or the email address of
the precursor's poster, as in
Joe D. Bloggs <jd******@foo.example> wrote:
or
Helmut Schmidt <he****@bar.example> schrieb:

The attribution MAY contain also a single newsgroup-name (the one
from which the followup is being made), the precursor's message
identifier and/or the precursor's Date and Time. Any of these that
are present, SHOULD precede the name and/or email address. However,
the inclusion or not of such fields SHOULD always be under the
control of the poster.

To enable this line, and the message identifier and the email address
within it, to be recognized (for example to enable suitable reading
agents to retrieve the precursor or email its poster by clicking on
them), the following conventions SHOULD be observed:
o The precursor's message identifier SHOULD be enclosed within
<...> or <news:...>
o The precursor's poster's email address SHOULD be enclosed within
<...>
o The various fields may be separated by arbitrary text and they
may be folded in the same way as headers, but attributions SHOULD
always be terminated by a ":" followed by CRLF.

Further examples:

On comp.foo in <12**@bar.example> on 24 Dec 2001 16:40:20 +0000,
"Joe D. Bloggs" <jd******@bar.example> wrote:
Am 24. Dez 2002 schrieb Helmut Schmidt <he****@bar.example>:

For general information see

<http://pointedears.de/ObjectInspector>


I prefer this URL to it:

http://www.stud.tu-ilmenau.de/~thla-...r/nightly/late
st/index

Instead of masked pages where they attempt to hide the URL to the page.

But either way, its broken. I will leave it as an exercise to you, to
discover the flaw I found in it.


Is TU-Ilmenau an otherwise reputable institution? Ilmenau itself does
not seem worth indexing in my reasonably-large Atlas.
--
© John Stockton, Surrey, UK. ?@merlyn.demon.co.uk Turnpike v4.00 MIME ©
Web <URL:http://www.uwasa.fi/~ts/http/tsfaq.html> -> Timo Salmi: Usenet Q&A.
Web <URL:http://www.merlyn.demon.co.uk/news-use.htm> : about usage of News.
No Encoding. Quotes before replies. Snip well. Write clearly. Don't Mail News.
Jul 23 '05 #6
Dr John Stockton wrote:
JRS: In article <FI********************@comcast.com>, dated Sun, 24 Oct
2004 10:00:22, seen in news:comp.lang.javascript, Randy Webb
<Hi************@aol.com> posted :
<--snip-->
Is TU-Ilmenau an otherwise reputable institution? Ilmenau itself does
not seem worth indexing in my reasonably-large Atlas.


Not sure, I can't read what appears to be Danish to me but could just as
well be Swahilian since I can't read it.

http://www.tu-ilmenau.de/

If anybody can translate it.

--
Randy
comp.lang.javascript FAQ - http://jibbering.com/faq
Jul 23 '05 #7
Randy Webb <Hi************@aol.com> writes:
Not sure, I can't read what appears to be Danish to me but could just
as well be Swahilian since I can't read it.
Unsurprisingly (from the .de toplevel domain) the page is in German.

The prefix "tu-" in German domain names usually refer to "Techische
Universitšt", i.e., a technical university (as the copyright notice
also says).
http://www.tu-ilmenau.de/

If anybody can translate it.


I would have supposed that clicking the "Englisch" link at the top left
would help, but it doesn't appear to do anything.

For an automated translation, you can try:
<URL:http://www.systranbox.com/systran/box?systran_lp=de_en&systran_id=SystranSoft-en&systran_url=http://www.tu-ilmenau.de/uni/index.php&systran_f=1098719567>
/L
--
Lasse Reichstein Nielsen - lr*@hotpop.com
DHTML Death Colors: <URL:http://www.infimum.dk/HTML/rasterTriangleDOM.html>
'Faith without judgement merely degrades the spirit divine.'
Jul 23 '05 #8
Lasse Reichstein Nielsen wrote:
Randy Webb <Hi************@aol.com> writes:

Not sure, I can't read what appears to be Danish to me but could just
as well be Swahilian since I can't read it.

Unsurprisingly (from the .de toplevel domain) the page is in German.

The prefix "tu-" in German domain names usually refer to "Techische
Universitšt", i.e., a technical university (as the copyright notice
also says).


I thought maybe German. But German, Danish, or Swahilian, I can't read
any of it :)
http://www.tu-ilmenau.de/

If anybody can translate it.

I would have supposed that clicking the "Englisch" link at the top left
would help, but it doesn't appear to do anything.


Believe it or not, I did try that, just didn't note it.
For an automated translation, you can try:
<URL:http://www.systranbox.com/systran/box?systran_lp=de_en&systran_id=SystranSoft-en&systran_url=http://www.tu-ilmenau.de/uni/index.php&systran_f=1098719567>


Thanks.

--
Randy
comp.lang.javascript FAQ - http://jibbering.com/faq
Jul 23 '05 #9
Lasse Reichstein Nielsen wrote:
Randy Webb <Hi************@aol.com> writes:
Not sure, I can't read what appears to be Danish to me but could just
as well be Swahilian since I can't read it.
Unsurprisingly (from the .de toplevel domain) the page is in German.


And, unsurprisingly, the home page some people are whining about here
(<http://www.tu-ilmenau.de/>) is not related to me except of that my
website is currently hosted by the computing center of the university;
but then I don't expect people who apparently don't know anything about
DNS to recognize /~thla-in/ as a reference to my home directory there
and the domain I have registered at DENIC (pointedears.de) to be but
a shortcut to that web site (until I'll move it; so far for masking).
The prefix "tu-" in German domain names usually refer to "Techische ^n Universitšt", i.e., a technical university (as the copyright notice
also says).


Exactly. And maybe you have heard of the International Student Week
in Ilmenau (ISWI, see <http://iswi.org/>) and the Fraunhofer IDMT
there led by Professor Brandenburg, one of the inventors of MP3,
among others. Then again, maybe you have not ...
http://www.tu-ilmenau.de/

If anybody can translate it.


I would have supposed that clicking the "Englisch" link at the top left
would help, but it doesn't appear to do anything.


I would be glad if you informed the webmaster about that bug.
PointedEars
Jul 23 '05 #10
Dr John Stockton was again babbling the following incompetent nonsense:
Tank Engine is possibly unaware of Usefor Work-In-Progress <URL:
http://www.ietf.org/internet-drafts/draft-ietf-usefor-useage-00.txt>
(CHL, May 2004) :-


<cite>
Status of this Memo

This document is an Internet-Draft and is in full conformance with
all provisions of Section 10 of RFC 2026.

Internet-Drafts are working documents of the Internet Engineering
Task Force (IETF), its areas, and its working groups. Note that
other groups may also distribute working documents as Internet-
Drafts.

Internet-Drafts are draft documents valid for a maximum of six
months and may be updated, replaced, or obsoleted by other
documents at any time. It is inappropriate to use Internet-Drafts
as reference material or to cite them other than as "work in
progress."

[...]
</cite>

PointedEars
--
The streets will run red with the bllod of the unbelievers! ;)
Jul 23 '05 #11
JRS: In article <19****************@PointedEars.de>, dated Sun, 7 Nov
2004 18:12:39, seen in news:comp.lang.javascript, Thomas 'PointedEars'
Lahn <Po*********@web.de> posted, quoting without any indication an
article now over a fortnight old :
Dr John Stockton was again babbling the following incompetent nonsense:
Tank Engine is possibly unaware of Usefor Work-In-Progress <URL:
http://www.ietf.org/internet-drafts/draft-ietf-usefor-useage-00.txt>
(CHL, May 2004) :-


<cite>
Status of this Memo

This document is an Internet-Draft and is in full conformance with
all provisions of Section 10 of RFC 2026.

Internet-Drafts are working documents of the Internet Engineering
Task Force (IETF), its areas, and its working groups. Note that
other groups may also distribute working documents as Internet-
Drafts.

Internet-Drafts are draft documents valid for a maximum of six
months and may be updated, replaced, or obsoleted by other
documents at any time. It is inappropriate to use Internet-Drafts
as reference material or to cite them other than as "work in
progress."

[...]
</cite>


That is correct - but have you studied the rest of it? It appears not,
since you are not yet in compliance with its views. It is indeed a
working document, indicating current thinking among a considerable group
of Usenet experts. It is therefore better, as an indication of well-
considered practice, than some ancient material written for users of
some local hierarchy.

So please cease your outdated rantings, and learn to live, as the
majority of the German people have - with some past difficulty - been
persuaded to do, in harmony with the civilised world.

And do not revive ancient threads, unless you have a contribution of
absolute value to make; it is a childish practice. You are not as
important as you think you are.

--
© John Stockton, Surrey, UK. ?@merlyn.demon.co.uk Turnpike v4.00 MIME ©
Web <URL:http://www.uwasa.fi/~ts/http/tsfaq.html> -> Timo Salmi: Usenet Q&A.
Web <URL:http://www.merlyn.demon.co.uk/news-use.htm> : about usage of News.
No Encoding. Quotes before replies. Snip well. Write clearly. Don't Mail News.
Jul 23 '05 #12

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

2 posts views Thread by Ken Tuck | last post: by
2 posts views Thread by yihan | last post: by
2 posts views Thread by Lars Forslin | last post: by
1 post views Thread by Ryan Stewart | last post: by
8 posts views Thread by ericgorr | last post: by
2 posts views Thread by sebastian.janoschka | last post: by
10 posts views Thread by cjparis | last post: by
reply views Thread by MrMoon | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.