Home > UI/UX Development > JavaScript (Page 2)

Array functions in javascript

Javascript array functions 1. toString() - convert array to string [crayon-6890952ad2365441447988/] 2. pop() - remove/delete last element from an array [crayon-6890952ad236a350772886/] 3. push() - add/insert element at the top [crayon-6890952ad236d936247262/] 4. shift() - remove/delete first element from an array [crayon-6890952ad236e974958475/] 5. unshift() - add/insert element at first position [crayon-6890952ad2370832467587/] 6. concat() - merged(concat) existing array and create new array [crayon-6890952ad2372058814478/] 7. slice() -

This Article is TAGGED in , , , , , , , . Read more

How to create/build web application in Angular?

1. Download and install Node Package Manager(npm) Link to download npm (https://nodejs.org/en/download/) 2. Then install ANGULAR CLI globally Open cmd and Run command [crayon-6890952ad2778502946434/] It can install angular globally 3. To Check version on command [crayon-6890952ad277d228633580/] [crayon-6890952ad2780323598732/] [crayon-6890952ad2782964159879/] 4. Create new project Open terminal and run command [crayon-6890952ad2784759652586/] Here we create project name my-app Angular cli installs npm packages and creates project files 5. Run

This Article is TAGGED in , . Read more

Show specific number of words in string using JavaScript

<p id="shortWord"></p> <script> var word = "Lorem Ipsum is simply dummy text of the printing and typesetting industry." var wordArr = word.split(" "); var wordShort = wordArr.splice(0, 5).join(" "); document.getElementById('shortWord').innerHTML= wordShort; </script> Output: "Lorem Ipsum is simply dummy"  

This Article is TAGGED in , . Read more

17 Useful jQuery Tricks and Best Practices

In the previous article, we learned about Common jQuery Ajax methods and options. In this article, we will cover the some general Do's and Dont's or Best Practices in jQuery, which is helpful to increase your page speed and will optimize code. jQuery is the most popular client-side library. It has

This Article is TAGGED in , , , , , , . Read more

Protractor: Add data in excel sheet using exceljs in node

Prerequisite:To perform write operation on excel sheet we need node application and exceljs library installed. Below is the code for different write action on excel file. Add sheet to new excel file [crayon-6890952ad2933494922594/] Add row in new sheet [crayon-6890952ad2937687858207/] Edit Existing Excel File [crayon-6890952ad293a979051156/]

This Article is TAGGED in , , , , . Read more

event.preventDefault() vs event.stopPropagation() vs return false

This article provides the information how can we prevent default behavior/action of an element in jQuery. Sometimes we need to stop/prevent element default action when a certain event is fired using jQuery.Event object methods we can achieve that event. We will see all three methods with a DEMO  event.preventDefault() event.preventDefault();  method is stop default

This Article is TAGGED in , , , , . Read more

jQuery .html vs .append vs .innerHTML Difference and Performance

This article provides the information about jQuery DOM insertion methods Difference and Performance. These methods are really matters for your page, It dramatically affects the performance of your page. .html() The .html() jQuery method set and return the content of selected elements. When this method is used to set content, It set the content

This Article is TAGGED in , , . Read more

DOM traversing & manipulating in JavaScript

Hello everyone, in this post we will discuss about following points on Document Object Model (DOM). What is DOM? DOM traversing DOM manipulating What is DOM? The Document Object Model (DOM) is a programming API for HTML and XML. API specification defined by the World Wide Web Consortium (W3C). DOM represents how to write HTML and

This Article is TAGGED in . Read more

What is difference offset() and position()

Hello everyone, in this post we will discuss about difference between offset() and position() with example. offset() The offset() method set or returns the offset coordinates (current position) for the selected elements, relative to the document. offset() returns an object containing the properties top and left coordinate value. When positioning a new element on

This Article is TAGGED in . Read more