JavaScript Tutorials, Tips & Tricks

JavaScript is an open scripting language that enables Web authors to design interactive sites. Can interact with HTML source code and is supported by most browsers.

21 JavaScript Tips and Tricks for JavaScript Developers

21 JavaScript Tips and Tricks for JavaScript Developers
If you are doing lot of JavaScript programming, you might find below list of code snippets very useful. Keep it handy (bookmark it) and save it for future reference.Here are 20 very useful JavaScript tips and tricks for you.Disclaimer: Not all these snippet are written by me. Some of them are collected from other sources ...

How to convert Javascript Arrays to CSV (Comma separated values)

Let's see a small code snippet in Javascript that converts JS arrays in Comma separated values. It is also possible to convert an array to delimited text where one can choose the separator.var fruits = ;var str = fruits.toString();//print str: apple, peaches, oranges, mangoesThe toString() method converts an array into a String and returns the result. The returned string will separate the elements in ...

jQuery :not() selector example

jQuery :not() selector example
It's been a while since I wrote about JQuery. I am spending most of my time these days on backend technologies. Recently while working on a typical requirement on UI, I had to play with some tricky JQuery selectors.Typically, most of the times we uses JQuery's class selectors or id selectors for example:$('#someid').hide(); $('div#container').css('height', '100%');$('.someclass').hide(); $('div.entry').css('height', '100%');But recently I had a requirement where I had to ...

Deleting Multiple Values From Listbox in JavaScript

Deleting Multiple Values From Listbox in JavaScript
There was a requirement of deleting multiple options from a listbox using JavaScript. User can select multiple items from a Listbox. Once the delete button is pressed, remove all the values that are selected from the combobox.Now the most intuitive solution for this problem would be to iterate through each option from the listbox and ...

STOP SOPA JQuery Plugin

STOP SOPA JQuery Plugin
Right now, Internet is experiencing the biggest protest since its inception. We have seen people protesting against Companies, Government, Dictators etc. Also Internet has become their voices in form of Twitter & Facebook.But today we saw something completely new. Major websites such as Wikipedia and Google are openly demonstrating their protest against new legislation bills ...

Facebook Style Scroll Fixed Header in JQuery

While doing some UI changes of a website, we had to implement a FIX header which remains fix on top of screen while scrolling. Facebook has a similar header which remains on top of content.Now for this, there are number of jQuery plugins available out there! But in our case we weren't allowed to add any new plugins to the technology stack of application ...

Create ZIP Files in JavaScript

Create ZIP Files in JavaScript
Zip is a very useful file type if I must say most used. It is the most used file format for data compression and archiving. There are number utilities available to create/generate Zip file. Also most of the programming languages comes up with API supporting to generate Zip files. I have written a couple of articles ...

Create a Clearable TextBox with jQuery

Create a Clearable TextBox with jQuery
Recently I came across a wonderful article by David Walsh on Clearable Textboxes with Dojo Toolkit . This is a simple implementation where a clear button (x) added in a textbox which lets user to clear the content of the textbox. I have seen this simple feature in many websites and feel its very ...

jQuery: Get the Text of Element without Child Element

While writing code in jQuery, I often use .text() method to get the content of any element from DOM. This function is straight forward, it strips off all the html element from a selected element and returns the remaining text.So for below element the .text() method will return "A quick brown fox".<div id="foo"> A quick brown fox </div> <script> $("#foo").text(); ...

Dynamically shortened Text with “Show More” link using jQuery

Dynamically shortened Text with
Update: The plugin is now on GitHub: https://github.com/viralpatel/jquery.shortenFacebook user updates has a great functionality. If the comment text is larger than few characters, the extra words are hide and a show more link is presented to user. This way you can keep long text out of the view to user and stop the ...
Tags: , ,
Page 1 of 612345...Last »