Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

ns6.1 - right click; select whole document, copy/paste in clipboard

Status
Not open for further replies.

Guest_imported

New member
Jan 1, 1970
0
0
0
Hi!
I'm not a native speaker, that's why there'll be a few mistakes.
I have a few questions concerning javascript.

Is it possible to block the right mouseclick or to start an js when the contextmenu is opened in the newer ns6 or in the new ns6.1?
Has anyone a script?

Another question:
Is it possible to select the text in the whole document, like strg + a ?
I know how to select text in an input or in a textfield, but I would need a script, that selects the whole text in the whole document!

And last but not least:
Is it possible to copy and paste some text or other things into the clipboard with javascript. (I think I saw such a script on a site, but this script was encoded...)


I hope someone can help me!
Thanks!

Borkert
 
hmm, thanks for your answer.
I went there but I'm not very familiar with javascript!
Maybe you can write a functionable script?
any help would be appreciated!
 
this gets rid of the ability to right click in msie and netscape < 6. i can't figure out how too cancel it in ns6 (well i did but you have to hide the window for 50ms. hehe)

<script>

<!--
function click(e) {
if(document.all) {
if (event.button==2) {
alert(&quot;no right click allowed&quot;)
}
} else if (document.layers) {
if(e.which == 3) {
return false
}
} else if (document.getElementById && !document.all) {
if(e.which == 3) {
e.preventDefault()
e.stopPropagation()
return false;

}
}
}

if(document.all) {
document.onmousedown = click
} else if(document.layers) {
document.captureEvents(Event.MOUSEDOWN);
document.onmousedown = click;
} else if(document.getElementById && !document.all) {
document.addEventListener(&quot;mousedown&quot;, click, true);
}
// -->
</SCRIPT>
 
i'll look into a way too select/copy the whole page in ns6, i gotta read up on ns6 anyways. hopefully if no ones answered your post by sat. i'll have something :) good luck.
 
This is really cool!
I hope that you find a script, which selects and copies the whole page on netscape and on internet explorer!
thanx a lot!
bye, borkert!
 
But it would be really enough if the script can select the whole text of the document like STRG +A (Ctrl+A).
That would be great if anyone can write such a script!
 
hmm, it's very difficult to find such a script, but I hope that someone knows how to write that...
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top