Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Javascript > Access browser menu (copy/paste) from Javascript

Reply
Thread Tools

Access browser menu (copy/paste) from Javascript

 
 
Bani
Guest
Posts: n/a
 
      03-31-2005
Is it possible to get browser-menu events (IE) into Javascript?

I have a special copy/paste on the onkeydown event (ctrl+c/ctrl+v). Now
the users would like to trigger it also from the browser menu.

 
Reply With Quote
 
 
 
 
Matt Kruse
Guest
Posts: n/a
 
      03-31-2005
Bani wrote:
> I have a special copy/paste on the onkeydown event (ctrl+c/ctrl+v).
> Now the users would like to trigger it also from the browser menu.


<body onCopy="myfunc()" onPaste="myfunc2()">

--
Matt Kruse
http://www.JavascriptToolbox.com


 
Reply With Quote
 
 
 
 
McKirahan
Guest
Posts: n/a
 
      03-31-2005
"Bani" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed) ups.com...
> Is it possible to get browser-menu events (IE) into Javascript?
>
> I have a special copy/paste on the onkeydown event (ctrl+c/ctrl+v). Now
> the users would like to trigger it also from the browser menu.
>


What do you mean by "browser menu"?

Browsers have Cut, Copy, and Paste functions under "Edit" on the Menu Bar.

Or do you mean the right-click context menu?


 
Reply With Quote
 
Bani
Guest
Posts: n/a
 
      03-31-2005
I haven't seen this two event-handlers in my documentation. But it
works!

Thank you.

Does it work also for other browsers then IE?

 
Reply With Quote
 
McKirahan
Guest
Posts: n/a
 
      03-31-2005
"Bani" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed) oups.com...
> I haven't seen this two event-handlers in my documentation. But it
> works!
>
> Thank you.
>
> Does it work also for other browsers then IE?
>


It works for me under FF and NS6.2.


 
Reply With Quote
 
Csaba Gabor
Guest
Posts: n/a
 
      03-31-2005
Are you sure about that? onPaste has been logged as a Mozilla bug
at https://bugzilla.mozilla.org/show_bug.cgi?id=280683
(you can, however, mostly monitor a textbox/textarea for change in
FF though the buggy method at
https://bugzilla.mozilla.org/show_bug.cgi?id=285272)

Also, I just tried the snippet below in my Firefox 1.0.1+ and got
no alert boxes vs both alert firing for IE 6 (on my Win XP Pro).


<body onpaste="alert('Body paste')">
<form name=mine method=get action=''>
<input name=tbtest onpaste="alert('Input paste')">
</form>
</body>

Csaba Gabor from Vienna

McKirahan wrote:
> "Bani" <(E-Mail Removed)> wrote in message
> news:(E-Mail Removed) oups.com...
>
>>I haven't seen this two event-handlers in my documentation. But it
>>works!
>>
>>Thank you.
>>
>>Does it work also for other browsers then IE?

>
> It works for me under FF and NS6.2.

 
Reply With Quote
 
McKirahan
Guest
Posts: n/a
 
      03-31-2005
"Csaba Gabor" <(E-Mail Removed)> wrote in message
news:%FW2e.18135$(E-Mail Removed)...
> Are you sure about that? onPaste has been logged as a Mozilla bug
> at https://bugzilla.mozilla.org/show_bug.cgi?id=280683
> (you can, however, mostly monitor a textbox/textarea for change in
> FF though the buggy method at
> https://bugzilla.mozilla.org/show_bug.cgi?id=285272)
>
> Also, I just tried the snippet below in my Firefox 1.0.1+ and got
> no alert boxes vs both alert firing for IE 6 (on my Win XP Pro).
>
>
> <body onpaste="alert('Body paste')">
> <form name=mine method=get action=''>
> <input name=tbtest onpaste="alert('Input paste')">
> </form>
> </body>
>
> Csaba Gabor from Vienna
>
> McKirahan wrote:
> > "Bani" <(E-Mail Removed)> wrote in message
> > news:(E-Mail Removed) oups.com...
> >
> >>I haven't seen this two event-handlers in my documentation. But it
> >>works!
> >>
> >>Thank you.
> >>
> >>Does it work also for other browsers then IE?

> >
> > It works for me under FF and NS6.2.


Here's what I used to test:

<html>
<head>
<title>CopyPaste.htm</title>
<script type="text/javascript">
function myCopy() {
alert("Copy");
}
function myPaste() {
alert("Paste");
}
</script>
</head>
<body onCopy="myCopy()" onPaste="myPaste()">
<form>
<textarea cols="50" rows="10">Hello World</textarea>
</form>
</body>
</html>


 
Reply With Quote
 
Thomas 'PointedEars' Lahn
Guest
Posts: n/a
 
      04-03-2005
McKirahan wrote:

> "Bani" <(E-Mail Removed)> wrote [...]:
>> I haven't seen this two event-handlers in my documentation. But it
>> works!
>>
>> Thank you.
>>
>> Does it work also for other browsers then IE?

>
> It works for me under FF and NS6.2.


However, it is not Valid HTML and as such not supposed to work generally.
Relying on it is risky at best.


PointedEars°
--
Messen, was messbar ist, und messbar machen, was noch nicht messbar ist.
-- Galileo Galilei
 
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
Javascript Drop Down Menu Issue. Replacing Text of the Menu Ivann Javascript 1 07-22-2008 08:34 PM
Cross-browser Real-time Message, Remote JavaScript Callback, and Monitoring Browser States msdngroup ASP .Net Web Services 5 01-30-2008 06:26 PM
Cross-browser Real-time Message, Remote JavaScript Callback, and Monitoring Browser States msdngroup ASP .Net 5 01-30-2008 06:26 PM
Re: Cross-browser Real-time Message, Remote JavaScript Callback, and Monitoring Browser States msdngroup ASP .Net 0 12-15-2007 08:38 PM
Adding Access keys to menu items in the Menu control Mike Tavares ASP .Net Web Controls 2 01-05-2006 11:06 AM



Advertisments