Category: Javascript

For adding delay for execution of some action setTimeout() and setInterval() methods is begin used in JavaScript.

The setTimout() method execute the statement only once but setInterval() method execute repeatedly until the interval is not being cleared.

In this tutorial, I am using the setTimeout() method to stop the page from redirect as soon as the button gets clicked.

Page redirect after specified time with Javascript

Read More Page Redirect after specified time with JavaScript

Javascript

In this tutorial, I show you some jQuery plugins by using it you can capture the user signature on your web page.

They add a container on the web page where the user can draw its signature using mouse pointer.

I discuss the following plugins –

  • jSignature
  • Signature Pad
  • jQuery UI Signature

Capture signature in the webpage with jQuery plugins

Read More Capture Signature in the webpage with jQuery plugins

Javascript Jquery

JavaScript has some inbuilt method which easily converts an Array to string.

You traverse on the Array and concat value to a variable with a separator for string conversion if you are not familiar with methods.

Converting an Array to string in JavaScript

Read More Converting an Array to string in JavaScript

Javascript

Nowadays all modern browsers allow copying content to the clipboard with JavaScript.

But before this, it is not supported in most browsers because of security reasons. You need to ask the user to press CTRL+C to copy the currently selected text.

The ZeroClipboard library uses invisible Adobe Flash movie to copying content to Clipboard. It works well with most browsers.

In this tutorial, I show How you can copy content to the clipboard with or without Flash.

How to copying content to the Clipboard with JavaScript

Read More How to copying content to the Clipboard with JavaScript

How To Javascript

In this tutorial, I show How you can check whether an Array already contains a specific value or not.

This requires within the program in some cases like –

  • Stop new value from insert if it already exists in an Array.
  • Execute script when the Array contains the particular value.
  • etc.

If you are familiar with PHP, where you can use the in_array() function to search value in the Array and its returns the Boolean value ( TRUE or FALSE ).

There are inbuilt methods in jQuery and JavaScript that return the index position of the value which you can use for the search.

Read More Check if value exists in Array – jQuery and JavaScript

Javascript Jquery

Sometimes you may want to take more control over your user Browser when he/she opens your website in a Browser Window.

For example – you want to know when the user closes the Browser Tab and execute your code.

If you want to know How much time the user active on your website, in this case, you can use JavaScript. Using that you only enabled the timer when the user is an active tab in your website.

Or you want to run the Animation only when the user is active otherwise stop it.

This kind of functionality you have seen in the websites or PTC sites which provide ads viewing to the users. They only count the ads view when the user is active on their website until given time otherwise they cancel the view after the specific time.

In this tutorial, I show How you can use JavaScript to detect whether Browser Tab Window is active or not.

How to Detect Browser Window is active or not - JavaScript

Read More How to Detect Browser Window is Active or not – JavaScript

Javascript Jquery

Javascript

In this tutorial, I discuss How to use the for-in loop.

Introduction

for-in is an another type of looping statement within JavaScript. Which works similarly like a foreach loop in PHP.

When performing iteration with for-in then it returns key on each iteration.

It works with both –

  1. Array and
  2. Object

Read More for-in loop in JavaScript

Javascript

Did you ever thought to make an editable div element or <p>, <span>, etc. that works same like a Text field and Textarea.

Some websites allow the user to edit their content by just pointing to the content and start to update it.

You will already know that <div> is a read-only container that means you can’t edit the content inside of it.

In this tutorial, I show how you can do this with the contentEditable attribute.

How to make editable div element with contentEditable attribute

Read More How to make Editable Div Element with contentEditable Attribute

How To Javascript

If you are familiar with PHP where for reading parameters from URL you can use either $_GET or $_REQUEST which take the name of the argument and return value of it.

In the JavaScript, there is no direct way to read arguments from URL like in PHP you need to do some work for getting it.

In this tutorial, I show how you can read and extract parameters with JavaScript.

Read and Get Parameters from URL with JavaScript

Read More Read and Get Parameters from URL with JavaScript

Javascript