Category: JavaScript

How to redirect a page using jQuery ?

If you want to redirect a page , one of the best option is to use the window.location.replace method that can demonstrate the HTTP redirect instead of any jQuery trick. How to redirect a page using jQuery ? Below is a sample code snippet demonstrating the redirection of a page .

Collapsible links for subcategories in Docusaurus Sidebar

Are you looking at a way to get collapsible links under subcategories in Sidebar in Docusaurus?. We provide you few options in this blog post. One of the easiest way make the links under categories in docusaurus is to change set the docsSideNavCollapsible: true in the siteConfig.js. How to Get Collapsible Links for subcategories in Docusaurus Sidebar ? While the previous fix works only for…

Searching in an Array in JavaScript

If you want to search an array for a value in JavaScript and retrieve the index of the found array element , you can use the Array’s indexOf method. How to search for an element in an array in JavaScript ? When using the indexOf method , if the value is found, it returns the index representing the array element. If the value is not…

What is the Difference between window.location.href and top.location.href in JavaScript?

Sometimes, you might be using the JavaScript to get the current location of the page. You might come across 2 properties window.location.href top.location.href What is the Difference between window.location.href and top.location.href in JavaScript? The window.location.href will return the location of the current page. The top.location.href will return the location of the topmost window in the heirarchy. This can be generally be useful when using the…

How to Check if all elements in array are alphabets in JavaScript ?

JavaScript provides the every() method defined in the Array object which lets the developers to check and validate the contents of the array in JavaScript. How to Check if all elements in array are alphabets in JavaScript ? Below is a sample code snippet demonstrating the usage of the every() method to find out if all the elements in the array are alphabets. Note that…

How to clear the array in JavaScript?

There are times when you want to clear the array that you have already defined with entries and reuse it. For example Arry = [109,625,200]; How to clear the array in JavaScript? One of the easiest way to clear the array contents in JavaScript is setting the Array Length t0 0.

Popular jQuery Grid Plugins

Below is a list of some of the popular jQuery Grid Plugins. Popular jQuery Grid Plugins Brick Work gridscrolling.js Grid Accordion – Responsive WordPress Plugin Recreating the “Design Samsung” Grid Loading Effect Post Revolution – Amazing Grid Builder for WP Gridlock : Responsive CSS Grid System jQuery Gridmanager : Building Rows and Grids

How to pass a function as parameter in JavaScript ?

There are times when you might want to pass a function as argument to another function in JavaScript. The function keyword can work in multiple ways. It can act as a operator and a statement as well. Additionally , you can create an expression as well. How to pass a function as parameter in JavaScript ? We can pass a function as a parameter to…

Verify if the variable is a non-empty string in JavaScript

If you want to test if a variable that is defined is a non-empty string in JavaScript , you can use the typeof keyword to find if the type is a sring as well as check for the length of the string as shown below. How to verify if the variable is a non-empty string in JavaScript ? This will cause the else part to…

Top 10 JavaScript Drawing Libraries

Are you a Web developer and looking for the drawing libraries in JavaScript ?. In this blog post , we list out some of the popular JavaScript drawing libraries. Top 10 JavaScript Drawing Libraries D3.js Paper.js Raphael Processing.js Fabric.js p5.js Maker.js Snap.svg pixi.js Paths.js Are there any other interesting JavaScript drawing libraries that you use ?. Feel free to share them in the comments section.