Subscribe Facebook Twitter Google Plus Stumble upon

How To Handle Drag and Drop Event In JavaScript

Drag and drop is a user interface for transferring data between a "drag source" and "drop target" that may be in same application or in different applications. Any document element that has the HTML draggable attribute is a drag source and the the element where the HTML element dropped is drop target. In other words, drag and drop allows the user to click and hold the mouse button down over an element, drag it to another location, and release the mouse button to drop the element there. This techniques allow elements to be dragged and "dropped" within a web page or other. In this post I am going to describe the methods and examples to handle drag and drop event in JavaScript.

Drag and drop is always event based and JavaScript involves two sets of events, the first one is fired on drag source and another is fired on the drop target. All drag and drop event handlers are passed an event object that is like a mouse event object, with the addition of dataTransfer property. This property refers to a DataTransfer object that defines the methods and properties of the drag and drop application.

Here is a simple example of drag and drop event, where the text can be dragged into a textbox.

Drag This text on Textbox

You can use the following HTML code to display this example of drag and drop event.

<form>
<span draggable="true" ondragstart="event.dataTransfer.setData('text/plain','This text was dragged')">Drag This text on Textbox</span>
<input type=text></input>
<button type=reset>Clear</button>
</form>

Drag and drop operations are performed in different steps, the first of them is to set HTML elements attribute draggable. Only after setting elements attribute draggable browser allows you to drag any elements. You can make HTML elements draggable with adding attribute [draggable="true"] as the following.
<div draggable="true">This text is draggable</div>

Different Drag and Drop Events


A number of events are fired during various stages of the drag and drop operation. When the user begins a mouse drag over a drag source, the browser fires a dragstart event on the element instead of selecting the element content. After that drag event fires on the element continuously while dragging element then fired drop event while dropping on drop target. The different events fired during drag and drop operation on an element are given below.

dragstart

This event is fired on an element when a drag is started. The event handler for dragstart event should call dataTransfer.setData() to specify the data that the drag source is making available. You can also set dataTransfer.effectAllowed to specify which of the "move", "copy" and "link" transfer operations are supported and you can also call dataTransfer.setDragImage() to specify an image or document element to be used as the visual representation of the drag.
Read More »

How to create a Simple calculator Using HTML and JavaScript

Here are the steps to create a simple calculator using HTML and JavaScript which can evaluate simple arithmetic on integer numbers. Two types of inputs text and button are used here on a table within a form element and OnClick event was used to insert button values on the screen or to evaluate the numbers.

How to create a Simple calculator Using HTML and JavaScript

Steps to create a Simple calculator Using HTML and JavaScript


1. At first Insert a <form> element within <body> tag.
2. Create a table using <table> .....</table> tag.
3. Insert two types of Input text and button within table data of table row using <tr><td>....</td></tr> tag.
4. Assign OnClick event for all the buttons having numbers and arithmetic operators.
5. Give blank value for Clear(C) button.
6. Use eval() function to evaluate the numbers on OnClick event of equal to sign button.

Full HTML code for a Simple HTML calculator


<html>
<head></head>
<body>
<h3>Simple Calculator</h3>
<br/>
<form Name="calc">
<table border=2>
<tr>
<td colspan=4><input type=text Name="display"></td>
</tr>
<tr>
<td><input type=button value="0" OnClick="calc.display.value+='0'"></td>
<td><input type=button value="1" OnClick="calc.display.value+='1'"></td>
<td><input type=button value="2" OnClick="calc.display.value+='2'"></td>
<td><input type=button value="+" OnClick="calc.display.value+='+'"></td>
</tr>
<tr>
<td><input type=button value="3" OnClick="calc.display.value+='3'"></td>
<td><input type=button value="4" OnClick="calc.display.value+='4'"></td>
<td><input type=button value="5" OnClick="calc.display.value+='5'"></td>
<td><input type=button value="-" OnClick="calc.display.value+='-'"></td>
</tr>
<tr>
<td><input type=button value="6" OnClick="calc.display.value+='6'"></td>
<td><input type=button value="7" OnClick="calc.display.value+='7'"></td>
<td><input type=button value="8" OnClick="calc.display.value+='8'"></td>
<td><input type=button value="x" OnClick="calc.display.value+='*'"></td>
</tr>
<tr>
<td><input type=button value="9" OnClick="calc.display.value+='9'"></td>
<td><input type=button value="C" OnClick="calc.display.value=''"></td>
<td><input type=button value="=" OnClick="calc.display.value=eval(calc.display.value)"></td>
<td><input type=button value="/" OnClick="calc.display.value+='/'"></td>
</tr>
</table>
</form>
</body>
</html>


Read More »

Objective Questions on Application Layer in OSI/TCP/IP Model set-3

Get 1000's of Networking MCQs as pdf E-Book on Free Download Now

1) In a/an ........... of DNS resolver, instead of supplying a name and asking for an IP address, the DNS client provides the IP address and requests the corresponding host name.

A. Recursive queries

B. Iterative queries

C. Reverse queries

D. Inverse queries


2) For each resolved query, the DNS resolver caches the returned information for a time that is specified in each resource record in the DNS response. This is known as .........

A. Positive caching

B. Time To Live

C. Negative Caching

D. Reverse Caching


3) As originally defined in RFC 1134, .............. negative caching is the caching of failed name resolutions.

A. Positive caching

B. Time To Live

C. Negative Caching

D. Round Robin Load Balancing


4) ............... can reduce response times for names that DNS cannot resolve for both the DNS client and DNS servers during an iterative query process.

A. Positive caching

B. Time To Live

C. Negative Caching

D. Round Robin Load Balancing


5) The amount of time in seconds to cache the record data is referred to as the .........

A. Time To Cache

B. Time To Live

C. Time For Record

D. Time To Save


6) Which of the following issues arises, when multiple resource records for the same resource record type exist.

A. For the DNS server, how to order the resource records in the DNS Name Query Response message.

B. For the DNS client, how to choose a specific resource record in the DNS Name Query Response message.

C. Both of the above

D. None of the above.


7) To address the issues arises when multiple resource records for the same resource record type exist, RFC 1794 describes a mechanism named ................. to share and distribute loads for network resources.

A. Positive caching

B. Time To Live

C. Negative Caching

D. Round Robin Load Balancing


8) A ............ gets the data for its zones from locally stored and maintained files.

A. primary name server

B. secondary name server

C. ternary name server

D. primary name client


9) A ............. gets the data for its zones across the network from another name server.

A. primary name server

B. secondary name server

C. ternary name server

D. primary name client


10) The process of obtaining zone information across the network is referred to as a .........

A. zone obtaining

B. zone transfer

C. zone information

D. zone extracting

Read More »

Solved MCQ on Application Layer in OSI/TCP/IP Model set-2


1) In MIME header field, ............. is a world unique value identifying the content of this part of this message.

A. content-type

B. content-transfer-encoding

C. content-description

D. content-id


2) The Post Office Protocol, version 3, is a standard protocol with STD number 53 and it is described in .....

A. RFC 1939

B. RFC 0937

C. RFC 2821

D. RFC 2822


3) .............. is an electronic mail protocol with both client and server functions.

A. SMTP

B. MIME

C. POP

D. TCP


4) In authentication state of POP3 server, ............ is used to specify a mechanism by which both authentication and data protection can be provided.

A. USER

B. PASS

C. APOP

D. AUTH


5) In transaction state of POP3 commands, .......... retrieve the number of messages and total size of the messages.

A. STAT

B. LIST

C. RETR

D. DELE


6) A MIME compliant message must contain a header field with the ........ verbatim text.

A. MIME-version:1.0

B. MIME-version:1.1

C. MIME-version:2.0

D. MIME-version:2.1


7) In ......... name space, a name is assigned to an address. It is a sequence of characters without structure.

A. hierarchical

B. sequential

C. flat

D. addressed


8) The main disadvantage of a ......... name space is that it cannot be used in a large system such as the internet because it may be centrally controlled to avoid ambiguity and duplication.

A. hierarchical

B. sequential

C. flat

D. addressed


9) The ......... protocol defines a set of messages sent over either User Datagram Protocol(UDP) port53 or Transmission Control Protocol(TCP) port53.

A. Name space

B. DNS

C. Domain space

D. Zone transfer


10) Primary specifications for DNS are defined in which of the following Request for Comments(RFCs)?

A. 974

B. 1034

C. 1035

D. All of the above

Read More »

MCQ Questions on Application Layer in OSI/TCP/IP Model set-1


1) Which of the following is/are the important applications of application layer?

A. Electronic mail

B. World Wide Web

C. USENET

D. All of the above


2) The TCP/IP ............. corresponds to the combined session, presentation, and application layers of the OSI model.

A. session layer

B. presentation layer

C. application layer

D. None of the above


3) The .......... protocol is based on end-to-end delivery.

A. SMTP

B. TCP

C. IP

D. SCTP


4) The well-known port of SMTP server is ........

A. 110

B. 25

C. 50

D. 20


5) In SMTP header field, ............. is a summary of the message being sent which is specified by the sender.

A. Reply-to

B. Return-path

C. Subject

D. From


6) In SMTP herder field, .......... is added by the final transport system that deilvers the mail.

A. Reply-to

B. Return-path

C. Subject

D. From


7) In SMTP mail transaction flow, the sender SMTP establishes a TCP connection with the destination SMTP and then waits for the server to send a ..........

A. 220 service ready message

B. 421 service not available message

C. Both of the above

D. None of the above


8) In SMTP mail transaction flow, .......... is sent, to which the receiver will identify itself by sending back its domain name.

A. HELO

B. MAIL FROM

C. RCPT TO

D. DATA


9) ............ is a command-line tool designed for most UNIX-like operating systems, which does not define a method of transferring mail, but rather acts as a client/server that supports multiple mail protocols.

A. Recieivemail

B. Sendmail

C. MIME

D. POP


Read More »

How TweakBit PC Optimization Tools Actually SpeedUp Your PC Performance

Is your PC slow and annoying, takes more longer time at startup and shutdown. You have any difficulties while copying files, lunching application programs and even browsing web-pages or your important files were deleted accidentally. If yes, don't worry! your problem is going to be solved now. In this post I will tell you how you can solve all of your PC problems at once.

Why your PC Being Slow?


Your PC may be slow and annoying along with lots of problems, if your computer
  • Having unnecessary temporary files
  • Having unnecessary programs at startup
  • Having lots of files on recycle bin, browsing history and internet cookies.
  • Files got deleted in error or by a virus
  • Loading unnecessary programs and services on memory
  • Accidentally deleting system registry files. 

Read More:Top 5 Free Methods to Make Your Computer Faster

How TweakBit PC Optimization Tools SpeedUp Your PC Performance


Tweakbit provides two most powerful products that can speedup overall performance of your PC, which are PC SpeedUp and FixMyPC.

PC SpeedUp

TweakBit's PC SpeedUp Tool To SpeedUp Your PC Performance

The PCSpeedUp tool performs advanced checkup and find out the factors that slowing down your PC, which also corrects registry errors with safely transferring files on healthy sectors,  removes fragmentation using de-fragmentation utility, deletes temporary files automatically, removes unnecessary programs at startup and regularly empty your recycle bin. It also resolves incorrect system and internet settings along with improving PC startup and shutdown. It is integrated with automatic tools in order to make your run at optimal speed with optimizing CPU and memory utilization. You can also feel improvement on file open and save faster than before due to proper management of hard disk memory.

How to Increase Your PC Speed Using PCSpeedUp


You can easily increase overall speed your PC with simply downloading, installing and scanning your PC for resolving all of the errors on your PC. According to the test of "SoftwareTested.com", PCSpeedUp does indeed make a PC run faster with improved file copying speed (+29%), snappier opening of files (+33%) and faster system shutdown (+45%). Watch the following video in order to know how PCSpeedUp works really.


Following are the steps how you can download, install  and run PCSpeedUp on your PC.
  • At first Click Here to go PCSpeedUp download page.
  • Click on "Download Now" button, the installation file will automatically started to download.
  • After download finished double click on the downloaded file, it will started to install on your PC. 
  • When your installation have finished lunch the application with double clicking on the icon automatically created on desktop in order to start scanning of your PC. 

FixMyPC

TweakBit's FixMyPC Tool To Fix Your PC Errors

FixMyPC is powerful software tool to repair your PC system registry and ActiveX errors with cleaning out invalid keys, repair broken shortcuts and defragment the registry to make your PC more healthier and fast performance. This tool is equipped with special tool which detects ActiveX errors and fix them to run your PC smoothly. The most important functions of this tool is performing real time maintenance using four powerful tools: remote registry protection, auto-run protection, desktop protection and live privacy protection tool.

How to Repair Your PC Speed Using FixMyPC


You can easily repair problems of your PC with simply downloading, installing and scanning your PC for resolving all of the errors on your PC. Following are the steps how you can download, install  and run FixMyPC on your PC.
  • At first Click Here to go FixMyPC download page.
  • Click on "Download Now" button, the installation file will automatically started to download.
  • After download finished double click on the downloaded file, it will started to install on your PC. 
  • When your installation have finished lunch the application with double clicking on the icon automatically created on desktop in order to start scanning of your PC. 

Read More:How to Automatically Troubleshoot and Fix Computer Problems

Why You Should Use TweakBit PC Optimization Tools


Here are the most important reasons why TweakBit's PC optimizations tools are different from all the other similar types of tools used for speeding up your PC and why you should try these tools for running your PC smoothly.
  • All of the PC optimization tools provided by tweakbit are used and trusted by million users worldwide.
  • They have well managed frequently asked questions for pre-purchase, after-purchase and for any other technical problems you may have faced while using these tools.  
  • They have well documented user manuals for each tools on downloadable .pdf format.
  • You will get full 30 days to test their software products on risk free. If you are not satisfied with them, you get a full refund without any question asked.
  • You can find hundreds of best reviews provided by verified buyers of tweakbit products who are fully satisfied with the products.

Read More »

How to Write Prefect Email That Converts Well

How to Write Prefect Email That Converts Well
Creating an email list through subscription form from your blog or website and sending them a high converting email is the heart of your marketing strategy. When you write a new blog post, the people on your email list will be the first to read it and, when you offer a new product, the people on your email list will be the first to try it. Only collecting email list will not be sufficient for perfect email marketing, you also have to create and send an email that can convert your subscribers to customers well.

The most important factor for converting your email subscribers to your customers is creating a well organized email campaign which involves more than the layout and the content of your email. Your emails must have a killer click through rates with a special mix of the right content and a stellar layout along with the right strategy for sending emails to your subscribers.

Not all of the subscribers on your email list are not subscribed from the same page of your website or blog so all the subscribers' don't have same interest on your list. You have to categorize the subscribers on your list according to their interest and send them emails according to their interest category. You can create an email having perfect mix of right content and layout with maximum click through rate with the following ways.

Read More »

What is Bootstrap and How To Get Started With It

If you are a programmer, web developer  or you are interested on it, may likely heard the word bootstrap and want to learn more about it.  Bootstrap is the most popular mobile first front-end development framework which was created using HTML, CSS, and JavaScript for faster, easier and responsive web development.  

Bootstrap includes free collection of tools for creating HTML and CSS based web templates for topography, forms, buttons, tables, navigation, models, image slideshows and front end developments.  It provides clean and uniform solution for building an interface for developers with functional and built-in easy to customize components. 

Programmers preferred bootstrap framework since it is easy to get started with powerful grid system which allows you to create highly responsive web development along with including bundled CSS and JavaScript codes which saves time for developing web pages.  

How to get Bootstrap


You will get latest bootstrap with downloading from bootstrap official site or using it with CDN provided by bootstrap as given below. 
<!-- Latest compiled and minified CSS -->
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css" >
<!-- Optional theme -->
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap-theme.min.css">
<!-- Latest compiled and minified JavaScript -->
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/js/bootstrap.min.js"></script>

What's Included With Bootstrap


Once you have download the bootstrap compressed folder, you will get the following file structure when you extract the folder.
bootstrap/
├── css/
│   ├── bootstrap.css
│   ├── bootstrap.css.map
│   ├── bootstrap.min.css
│   ├── bootstrap.min.css.map
│   ├── bootstrap-theme.css
│   ├── bootstrap-theme.css.map
│   ├── bootstrap-theme.min.css
│   └── bootstrap-theme.min.css.map
├── js/
│   ├── bootstrap.js
│   └── bootstrap.min.js
└── fonts/
    ├── glyphicons-halflings-regular.eot
    ├── glyphicons-halflings-regular.svg
    ├── glyphicons-halflings-regular.ttf
    ├── glyphicons-halflings-regular.woff
    └── glyphicons-halflings-regular.woff2

How To Create Basic HTML Template  With Bootstrap


You will get very simple examples on getting started page on bootstrap, you can easily customize them for your own uses. The following example shows the basic codes for creating basic HTML template.
Read More »

How To Make All External Links Nofollow Using JavaScript

Creating a webpage with proper uses of internal and external links is the oldest and most used way of Search Engine Optimization(SEO). You can create the links in your webpage in two ways using "nofollow" tag, which tell the search engine and crawlers not to follow and crawl your hyperlinks and without using "nofollow" tag, which allows the search engine and crawlers to follow and crawl your hyperlinks.

The rel="nofollow" attribute helps to control the flow of page rank from one website to another and maintain the pagerank of your website. You can create a link with rel="nofollow" attribute as the following. 

<a href="https://www.google.com" rel="nofollow">My Link</a>

In this post, I am going to describe different ways of making all the external links of your webpage "nofollow" using simple JavaScript code and Jquery plugin which helps to prevent following SEO juice form your website to the external links.

You May Also Like:

Making All External Links Nofollow Using Simple JavaScript Code


You can make all of your external links with nofollow tag using the following simple JavaScript code. It adds  rel="nofollow" attribute along with target attribute to "_blank" and title attribute to "Click to open in new window" on <a href="#">Link</a> tag of all of the external links of your website
 <script type='text/javascript'>
function myFunction() {
    var x = document.getElementsByTagName("a");
    var i;
    for (i = 0; i < x.length; i++) {
      if (location.hostname!=x[i].hostname){
        x[i].rel = "nofollow";
        x[i].target = "_blank";
        x[i].title = "Click to open in new window";

}}}

mft=setTimeout("myFunction()",0);

function LoadEvent(func){

var oldonload = window.onload;

if (typeof window.onload != 'function'){
window.onload = func;
}
else{
window.onload = function()
{
if(oldonload)
{oldonload();}
func();}}} 
LoadEvent(function(){
myFunction();
});
</script>


Read More »

Best 10 Premium SEM SEO and Keyword Research Tools

Optimizing your website for search engines helps to increase the visibility of your website on search engines that increases the ranking and moves your website on the top of the search result. Only the best and premium SEM, SEO and keyword research tools can helps you to find the most profitable keywords  for your website niche to optimize your website content according the the suggestion. 

Here I have created the list of best and premium SEM, SEO and keyword research tools that helps to steal your competitors traffic and uncover their conversion strategy with displaying organic and paid search results along with top organic keywords along with their search trends and CPC and backlink details of your and competitors website.

1. SEMrush 


SEMrush - Premium SEM SEO and Keyword Research Tools

SEMrush is the best SEM, SEO and keyword research tool to find out and analyze the competitive data of your website or keyword which is mostly useful for website owners and digital marketing professionals. This tool helps to steal your competitors traffic and uncover their conversion strategy with displaying organic and paid search results along with top organic keyword and backlink details of your or competitors website which was generated from the biggest keyword database derived from all the search engines.

You will get the following analytics report with this tool to find out your competitors strategies in display advertising, organic and paid search, and link building.
  • Organic search results to find out your competitors best keywords  to discover new organic traffic for your website.
  • Paid search results to uncover your competitors online advertising strategies and budget.
  • Backlinks information to conduct deep link analysis and to understand about the referring domains. 
  • Video advertising research to uncover your competitors video advertising strategies to create effective video advertising campaign.
  • And keyword research result to find the right keywords for SEO and PPC campaigns.

Read More »

Payoneer:Best International Online Payment Processor -Review

Payoneer is a global online payment service provider for cost effect payment in more than 200 countries worldwide which provides international wire transfers, online payments, and prepaid master card service for freelancers, publishers and online affiliates. It provides own US and UK virtual checking bank account where you can directly receive payments from world wide and you will not need to convert money on your local bank account in local currency or can withdraw cash form any ATM or POS worldwide with taking lowest fees.
Payoneer:Best International Online Payment Processor -Review

Who Will Get Benefited


If you are online freelancer and delivering different services through online freelancing sites like upwork, guru, freelancer, fiverr, people per hour, 99designs etc. can receive your earnings through payoneer account. A single account works for all sites to receive the payment, once you have registered can connect all of them on your payoneer account. Publishers of any blog or website, online affiliates and other online marketers  can also be benefited with receiving payments from mass payout companies or requesting for payment  personally.

Who Uses This Service


Following of your trusted freelancing company, online publishing networks and affiliate networks along with other thousands of company and services accepts payments from payoneer.
  1. People Per Hour
  2. PopAds
  3. Guru.com
  4. PropellerAds 
  5. 99designs
  6. Amazon.com
  7. Avangate
  8. Elance
  9. Fiverr
  10. GoDaddy.com
  11. Inforlinks
  12. Linkshare
  13. Upwork
  14. ShareASale.com
  15. Taboola

Main Features and Benefits


You will get the following main features and benefits of  while using Payoneer as your online payment processor service.
  1. You will get easy to use and reliable payment system for getting payments from the US and EU company.
  2. There is no bank accounts needed, you wiill get your own US and UK virtual checking bank account.
  3. You will get payments from different ad networks and affiliate networks easily.
  4. It automatically converts to another currency while shopping or withdrawing from your local bank or ATM.
  5. You can send and receive payment globally with low monthly fee.
  6. It also allows transaction between payoneer accounts with a free of charge.
  7. You don't need to convert your currency, you will get money on your local bank account in local currency automatically.
  8. You will get payoneer prepaid mastercard to withdraw cash from any ATM worldwide.
  9. There are different apps for android and apple to check account balance. 
  10. You can load money from local bank to payoneer account.
  11. There are different payment options are available i.e. deposit to local bank account, master card and wire transfer etc.
  12. You can verify paypal, skrill and payza account with payoneer prepaid mastercard.
Read More »