General discussion

Locked

Annotate in Browser

By nanda ·
Hello Everybody,

I have a question. I want to display a button in the HTML page which should facilitate me to copy the contents that are selected by me in the displayed web page and I should be able to paste it somewhere (As Copy, Paste functionality available in browser). This should work in both browsers.

Please let me know the answer ....?

Thanx for your reply.

This conversation is currently closed to new comments.

5 total posts (Page 1 of 1)  
| Thread display: Collapse - | Expand +

All Comments

Collapse -

Annotate in Browser

by mukul_gandhi In reply to Annotate in Browser

As to my knowledge, it should not be possible with plain HTML and JavaScript programming. But with a Java Applet it should be possible. You need to interface Java with JavaScript. You can access system clipboard using Java APIs which will facilitateu to cut,copy,paste. But again this is not possible with untrusted applets. You will need signed applets for this.

regards
-mukul

Collapse -

Annotate in Browser

by nanda In reply to Annotate in Browser

The question was auto-closed by TechRepublic

Collapse -

Annotate in Browser

by rwiseman In reply to Annotate in Browser

...
<input type="button" value="copy" onclick="MyCopy()">
...
<script language="JavaScript">
function MyCopy() {
var selectedRange = document.selection.createRange();
selectedRange.execCommand("Copy");
}
</script>
...

Unfortunately, this is an IE4.0+ specific ability. The createRange function creates a text range object which includes whatever text is selected on the page. The Copy command is them executed which places the selected text to the clipboard.

Robert Wiseman

Collapse -

Annotate in Browser

by nanda In reply to Annotate in Browser

The question was auto-closed by TechRepublic

Collapse -

Annotate in Browser

by nanda In reply to Annotate in Browser

This question was auto closed due to inactivity

Back to Web Development Forum
5 total posts (Page 1 of 1)  

Related Discussions

Related Forums