Forum     

Go Back   Digit Technology Discussion Forum > Community > Tutorials
Register FAQ Calendar Mark Forums Read

Tutorials This section offers tutorials and How to's on just about anything related to computers and IT. Note: All tutorials are courtesy the posters and not verified by Digit


Closed Thread
 
LinkBack Thread Tools Display Modes
Old 15-08-2006, 10:47 AM   #1 (permalink)
In The Zone
 
rohan's Avatar
 
Join Date: Mar 2004
Location: Bangalore
Posts: 297
Default Short tutorials on Web Development


I had many tips and tricks in my mind... but giving them each a seperate new topic would be like spamming.. so I'll make a collection of simple and short tutorials here. Hope it helps you. I'll add more as I write more.

WDST 1:
Name: Using the clipboard from JavaScript
Platform-dependency: Works only in Internet Explorer 5+

This is a small tutorial form my side on how to use the clipboard from JavaScript. For those coming in late, the clipboard is a software concept where data is temporarily stored for users to access from within application i.e when you copy/paste things... data is written to/read from the clipboard. Here is a short tutorial on how to use the clipboard.

READ: You must be having basic knowledge of JavaScript before proceeding with this tutorial. The code mentioned here must be placed in the <script></script> HTML containers to work.

1. Getting data from clipboard ("Paste")

var clip = window.clipboardData;

Here, 'window.clipboardData' is an object which gives you access to the clipboard. It has two functions:

getData(datatype); //returns the data of the clipboard
setData(datatype, data); //sets the data on the clipboard

Now, we can use:

var clip = window.clipboardData;
var clipdata = clip.getData("Text");
alert(clipdata);

Here, we get the data from the clipboard to a variable called 'clipdata', which we then output by using the 'alert' function. You can also use the variable further anyway you want it.

now, why did we use "Text"... that specifies the datatype of the data we need. We can use "html", "Image" and a few other datatypes.. but "Text" is what you'll commonly use.

2. Putting data into clipboard ("Copy")

it's as simple as that:

var clip = window.clipboardData;
clip.setData("Text", "This is what you'll see in the clipboard");

Now, open any application which has copy/paste features and try pasting it... it'll paste "This is what you'll see in the clipboard".

NOTE: The window.clipboardData object is available only in Internet Explorer, it will not work in any other browsers. Since the browser scope is limited, it is generally used for making HTML applications like .hta one's which are meant to run with only Internet Explorer. Anyways in the future we can expect more browsers to suppor this feature.

======================================

Expect more soon
__________________
If there wasn't greed, we still would have been single-celled organisms.
rohan is offline  
Advertisements. Register and be a member of the community to get rid of them.
Advertisement

Old 19-08-2006, 01:51 AM   #2 (permalink)
Apprentice
 
- Snake -'s Avatar
 
Join Date: Jan 2005
Location: New Delhi, INDIA
Posts: 77
Default Re: Short tutorials on Web Development

Good tricks...

YOu can also post some layout tutorials etc...
__________________
I am a self thought geek and a wanna be Entrepreneur!
My Website | Github | Follow me on Twitter
- Snake - is offline  
Closed Thread

Bookmarks

Thread Tools
Display Modes

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 On


 
Latest Threads
- by chris
- by icebags
- by Tenida

Advertisement




All times are GMT +5.5. The time now is 01:27 AM.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2012, vBulletin Solutions, Inc.

Search Engine Optimization by vBSEO 3.3.2