Wrox Programmer Forums
| Search | Today's Posts | Mark Forums Read
Javascript How-To Ask your "How do I do this with Javascript?" questions here.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Javascript How-To section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old September 3rd, 2008, 12:49 PM
Friend of Wrox
Points: 2,876, Level: 22
Points: 2,876, Level: 22 Points: 2,876, Level: 22 Points: 2,876, Level: 22
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jun 2003
Location: Denver, CO, USA.
Posts: 428
Thanks: 57
Thanked 2 Times in 2 Posts
Default Onpaste/Clipboard problems

I have been banging my head on this problem for two days now!

I want to perform a javascript (or VBScript, don't really care which) AFTER text has been pasted to a textarea. The *&^%$ OnPaste event appears to fire BEFORE the text is pasted. I've tried delaying my code using setTimeout as suggested on numerous sites with no success. I've tried copying the the *&^%$ text from the clipboard myseslf before calling my routine, and any attempt to read the clipboard from script returns the "Clipboard undefined" error.

WTF is wrong with this code?

var strClipboardtext=Clipboard.GetData(DataFormats.Tex t);
 
Old September 3rd, 2008, 01:53 PM
Friend of Wrox
Points: 2,876, Level: 22
Points: 2,876, Level: 22 Points: 2,876, Level: 22 Points: 2,876, Level: 22
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jun 2003
Location: Denver, CO, USA.
Posts: 428
Thanks: 57
Thanked 2 Times in 2 Posts
Default

I found something that appears to work in JAVAScript:

window.clipboardData.getData('Text');

The example in my initial post was provided by none other than Microsoft, and was labelled JScript. So, can somebody explain to me the difference between JScript and Javascript, other than the obvious fact that JScript is not what I wanted?




Similar Threads
Thread Thread Starter Forum Replies Last Post
Clipboard bschleusner C# 2005 1 February 16th, 2007 08:20 AM
Clipboard Problem mjackson11 Visual C++ 1 December 7th, 2004 02:31 PM
Copy to Clipboard Clive Astley Access 5 July 16th, 2004 07:16 PM
the clipboard natmaster Java GUI 0 May 31st, 2004 02:16 PM
Saving to the clipboard xelepi Javascript How-To 2 November 7th, 2003 07:51 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.