Showing posts with label JavaScript. Show all posts
Showing posts with label JavaScript. Show all posts

Friday, March 27, 2020

Difference Betwixt == Together With === Equal Operator Inwards Javascript

In 1 of the recent JavaScript interview for a Java spider web evolution position, 1 of my readers was asked this questions, What is the divergence betwixt comparing variables inward JavaScript using "==" together with "===" operator?  My reader got shocked because he was from Java background together with doesn't receive got slap-up exposure to JavaScript, though he was pretty much familiar alongside to a greater extent than or less JavaScript function, trial handling, together with to a greater extent than or less jQuery tricks, he wasn't aware of subtle details of JavaScript. He did the right think, politely said that he is non aware of the difference betwixt == together with === operator. Though It did non impact his interview performance much, he was keen to know virtually this equally before long equally he finished his interview. He asked to me equally well, together with that's the argue of this post. In 1 word, main divergence betwixt "==" together with "===" operator is that formerly compares variable past times making type correction e.g. if y'all compare a number alongside a string alongside numeric literal, == allows that, but === doesn't let that, because it non alone checks the value but also type of 2 variable, if 2 variables are non of the same type "===" furnish false, piece "==" furnish true. 

We volition run across couple of illustration of both operator inward this article, to empathize divergence betwixt them much better.





Difference betwixt == together with ===  inward JavaScript

Since JavaScript back upward both strict equality together with type-converting equality, it's of import to know which operator is used for which operation. As I said that, === takes type of variable inward consideration, piece == brand type correction based upon values of variables, next are duet of to a greater extent than differences betwixt "==" together with "===" operator inward JavaScript programming linguistic communication :

1) When nosotros compare 2 variables of dissimilar type e.g. a boolean alongside a string or a number alongside String using == operator, it automatically converts 1 type into to a greater extent than or less other together with furnish value based upon content equality, piece === operator is strict equality operator inward Java, together with alone furnish truthful if both variable of same type together with also contains same value. This volition last much clear alongside following illustration of == together with === operator inward JavaScript :

0==false   // true, because imitation is equivalent of 0 0===false  // false, because both operands are of dissimilar type 2=="2"     // true, car type coercion, string converted into number 2==="2"    // false, since both operands are non of same type

2)  "==" operator is known equally type coercion operator together with anytime if both values are same together with compared using ==operator, type coercion happens. On the other mitt === is known equally strictly equality operator. It's much like Java's equality operator (==), which gives compilation fault if y'all compare 2 variables, whose types are non compatible to each other. In fact, y'all should e'er work "===" operator for comparing variables or but for whatsoever comparison.

3)  While comparing variable using strict equality operator inward Java, 2 object are strictly equal to each other if both are of same type together with they refer to same instance. Similarly 2 String are equal to each other if contents of each others are same e.g. same characters at same position. Another skillful follow-up inquiry is what would last number of comparing zip together with undefined using == together with === operator inward JavaScript. Well response is simple, when y'all work "==" operator it volition furnish true, piece if y'all work "===" or strict equality operator, it volition furnish false. 


4) One to a greater extent than follow-up inquiry of == vs === operator is divergence betwixt != together with !== operator inward JavaScript. I mean value it's pretty slow to deduct that !== operator is strict non equality operator, which volition receive got type into consideration piece comparing 2 variables or 2 values inward JavaScript.

5) Last but non the to the lowest degree inquiry related to this JavaScript interview inquiry is, what hand off if y'all compare Nan alongside whatsoever number or Nan itself, using  === operator,  You should shout out back that NaN (Not a Number) is non equal to anything, including NaN.



In 1 of the recent JavaScript interview for a Java spider web evolution put Difference betwixt == together with ===  Equal Operator inward JavaScript


That's all virtually difference betwixt "==" together with "===" JavaScript operator, y'all should e'er work strict equality operator i.e. === together with avoid using == operator fifty-fifty if y'all demand type coercion, instead convert the type past times yourself to larn inward to a greater extent than readable. By the way, it's 1 of the interesting JavaScript interview Question, together with y'all tin await inward beginner marker JavaScript interviews, much to the same, where Java developers are expected to know virtually customer side tools e.g. HTML, CSS together with JavaScript. 


Further Learning
10 Java Programming Practice questions for Beginners
10 Frequently asked SQL Query Interview Questions
Difference betwixt hold off together with slumber inward Java
Difference betwixt primary together with unique telephone commutation inward SQL
Difference betwixt clustered together with non-clustered index inward SQL

Wednesday, December 11, 2019

Helloworld - My Get-Go Jquery Program

What is jQuery
jQuery is nix but JavaScript library that comes amongst rich functionalities. It's modest in addition to faster than many JavaScript code written yesteryear an average spider web developer. By using jQuery nosotros tin write less code in addition to do to a greater extent than things, its makes spider web developer's chore rattling easy. In elementary word, jQuery is a collection of several useful methods, which tin last used to attain many mutual tasks inward JavaScript. H5N1 twain of lines of jQuery code tin do things which demand likewise many JavaScript lines to accomplish. The truthful ability of jQuery comes from it's CSS-like selector, which allows it to pick out whatever chemical element from DOM in addition to modify, update or manipulate it. You tin utilisation jQuery to do cool animations similar fade inward or fade out. You tin also alter CSS degree of a constituent dynamically e.g. making a constituent active or inactive. I accept used this technique to implement tabbed UI inward HTML. I tin vouch for jQuery that in 1 lawsuit you lot start using it, you lot volition never become dorsum to plainly erstwhile JavaScript, it's clear, concise in addition to powerful. You volition fifty-fifty regret why you lot are non using jQuery before.


What nosotros tin grip using jQuery

jQuery is rattling powerful, it provides methods in addition to API to do almost all kinds of affair you lot tin do amongst JavaScript. Though jQuery is specially practiced inward the next area
  •    HTML in addition to DOM manipulation
  •    CSS manipulation
  •    HTML resultant methods
  •    AJAX
  •    Utilities

By using jQuery you lot tin add together a novel chemical element into DOM, update existing chemical element from DOM in addition to tin easily take whatever element. jQuery's powerful degree in addition to id selector allow you lot to pick out whatever HTML chemical element or grouping of elements for selective manipulation. jQuery also allows you lot to pick out in addition to modify attributes from whatever HTML chemical element inward DOM.




How to Use jQuery

If you lot desire to utilisation jQuery, you lot merely demand to acquire jQuery file e.g jquery-1.2.6.min.js or latest version from its official site or whatever of iii pop CDN URL which provides jQuery download. For example <script type="text/JavaScript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.10.1/jquery.min.js" ></script> downloads jQuery from Google's content delivery network. You tin even ship jQuery library along amongst your app yesteryear saving downloaded file to your file-system location.

When nosotros desire to utilisation this nosotros accept to include this file to our programme file(i.e HTML file). For illustration this illustration loads jQuery from local drive rather than downloading it from internet. By the way, at that spot are about advantages of downloading jQuery using CDN networks. CDN stands for content delivery network. Some fourth dimension spider web developer also confuses where to position the script tag e.g. should nosotros position script tag on caput or body.

Well you lot tin position it anywhere but putting it on trunk brand to a greater extent than feel on functioning perspective, because inward that instance jQuery library volition last downloaded later on all HTML, CSS, Images are downloaded in addition to page is rendered. Even if it stuck downloading jQuery from meshing you lot volition non run across the blank page, which is the instance when you lot position script tag on head.

By the way, this consideration volition solely occur, if you lot determine to download jQuery from meshing rather than from local drive, in addition to if you lot the 1 who similar to run across all JavaScript dependency at the top of the page, hence position it inward head. I similar to position jQuery download code, correct at the top section, on head.


Simple jQuery  Example

Here is our start jQuery program, which does the actually elementary thing. There is a button, you lot merely demand to click it in addition to all of a precipitous you lot run across a welcome message on your screen. This is a practiced illustration of how you lot tin acquire a DOM chemical element in addition to add together novel HTML code there. In adjacent section, you lot volition run across a total explanation of this jQuery program.

<html>     <head>         <title>My First jQuery Program</title>         <meta charset="UTF-8">         <meta name="viewport" content="width=device-width">         <script type="text/JavaScript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.10.1/jquery.min.js" ></script>     </head>     <body>         <script type="text/javascript">             $(document).ready(function() {                 $("button").click(function() {                     $("#bClick").html("<h1>Hurry!!! </h1><h2>Welcome to wonderful basis of jQuery</h2>");                 });              });         </script>         Click the push to run across exhibit         <button>Click me</button>         <div id="bClick"></div>     </body> </html>

in addition to hither is the output, or how does it await similar inward your browser e.g. meshing explorer, chrome or Firefox :
 jQuery is nix but JavaScript library that comes amongst rich functionalities HelloWorld - My First jQuery Program

Explanation of code:

jQuery syntax is made for selecting HTML elements in addition to performing about activity on the element(s). Basic syntax is: $(selector).action(), here $ sign is short-cut of jQuery() method in addition to used to define/access jQuery.  (selector) is used to "query (or find)" HTML elements, in addition to tin last whatever CSS mode selector or special jQuery selectors.  jQuery action() is the chore to last performed on the selected element(s). For example, inward our program, nosotros accept  $(document).ready(function() { ...});  which is where your all jQuery code should go. This method is executed in 1 lawsuit browser finished loading HTML page in addition to DOM is ready to last accessed. $("button") is used to acquire all HTML push chemical element since at that spot is solely 1 here, nosotros volition acquire a reference of that. click() is used to heed to click event, in addition to it registers listener the anonymous business office you lot passed to it. The code hither is executed when push is clicked. If you lot await our code, you lot volition run across that nosotros are in 1 lawsuit again getting reference of an HTML chemical element whose id is bClick, $("#bClick") returns a DIV amongst id bClick, # is used to announce ID, in addition to this type of selector is known every bit ID selector. Once you lot acquire this element, you lot laid it's HTML yesteryear passing the HTML text to it, which is what displayed when you lot click the button.


Good for a start jQuery program, I am certain the to a greater extent than you lot do, the to a greater extent than started loving it. If you lot desire to start serious evolution inward jQuery, I propose to become through this list of about practiced jQuery books in addition to uncovering 1 you lot like. It makes feel for all front-end spider web developers to at-least know jQuery. By the way, JavaScript is getting tons of practiced library, which is driving a lot of practiced development. H5N1 twain of other useful JavaScript library are Angular.js in addition to Node.js, I am certain you lot heard well-nigh them every bit well. Comparing to jQuery at that spot all the same inward the early on state, on the other hand, jQuery has almost captured all JavaScript front-end market.

Further Reading
The Complete jQuery Course: From Beginner To Advanced!
Up in addition to Running amongst jQuery
jQuery Fundamentals By Dan Wahlin

Saturday, November 23, 2019

10 Event Of Jquery Selectors For Spider Web Developers

I am primarily a Java developer but I accept done a lot of operate alongside Java spider web application including Servlet, JSP, as well as JavaScript on the customer side. It was hard for me to perform customer side validation using JavaScript but ever since I come upwards to know most jQuery, I only dear to practise to a greater extent than validation as well as other materials on the customer side. The jQuery gives you lot immense ability to practise things alongside HTML pages as well as one-half of that ability comes from its CSS-like selector engine, which allows you lot to select whatever chemical constituent or grouping of elements from HTML page as well as thence practise things alongside them e.g. changes their mode or behavior. For example, you lot tin pick out handle of the divs as well as cover them, you lot tin pick out handle of the buttons as well as brand them clickable as well as thence on. In gild to acquire jQuery, you lot quest to acquire its selector engine as well as inwards this tutorial, I am going to portion you lot 10 skillful examples of dissimilar jQuery selectors e.g. ID selector to select unmarried HTML element, the shape selector to select grouping of an chemical constituent as well as * wildcard to select all elements. Since jQuery supports many types of a selector, approximately of them I didn't fifty-fifty know, it's skillful to know every bit much every bit possible most them.


So hither is the listing of 10 jQuery selector I am going to portion alongside you lot guys:
1) id selector
2) shape selector
3) tag selector
4) descendant selector
5) kid selector
6) pseudo-class selector
7) multiple selectors
8) non selector
9) all selector
10) has selector

Now, let's encounter approximately examples of each of these jQuery selectors as well as when to occupation which jQuery selector




jQuery ID selector Example
Id selector is 1 of the most used jQuery selectors as well as used to select exactly 1 specific chemical constituent from a page. For example, $("#main") volition render the HTML chemical constituent alongside id every bit main. exactly similar CSS, you lot quest to occupation # (hash) to select chemical constituent alongside their IDs. It's too the fastest selector as well as if you lot tin occupation thence e'er prefer ID selector. They are too really pop inwards jQuery interviews as well as you lot volition e'er encounter 1 to a greater extent than 2 questions from ID selector.

examples:

// Select HTML chemical constituent alongside id every bit primary e.g. div id="main" $("#main") volition   // Select HTML chemical constituent alongside id every bit guess_box e.g. div id="guess_box" $("#guess_box") volition 


jQuery shape selector Example
The shape selector is approximately other most mutual jQuery selector as well as used to select a grouping of elements from HTML page. If you lot remember, the shape is used to mode elements inwards jQuery but it tin too occupation to grouping related elements together inwards jQuery fifty-fifty if they don't accept whatever style. Just similar inwards CSS, a shape selector is started alongside a . (dot) e.g. $(".active") volition render all elements from page which has class="active".

Here is a duo of examples of jQuery shape selector:

// select all elements alongside shape every bit active e.g. all divs $(".active")  // select all elements alongside shape every bit clickable e.g. all clickable divs $(".clickable") 

If you lot recollect the $() is a shortcut of jQuery() method as well as if you lot occupation jQuery you lot may acquire the mistake similar "Uncaught ReferenceError: $ is non defined" if the browser is non able to charge the jQuery properly.


jQuery tag selector Example
The jQuery tag selector, too known every bit element selector selects all the specified chemical constituent from the HTML page. For example, $("p") volition select all paragraphs as well as $("div") volition select all divs. Internally tag selector calls the getElementsByTagName() occupation to render the appropriate elements from DOM.

// select all bridge elements $("span");


jQuery descendant selector Example
The descendant selector selects all elements that are descendants of a given ancestor. The format of this selector is $(ancestor descendant) where ancestor is whatever valid selector as well as descendant is a valid selector to filter descendant elements. For example, $( "form input" ) volition render whatever input which are descendant of shape chemical constituent i.e. they are within whatever form.  See Head First jQuery to acquire to a greater extent than most advanced selector inwards jQuery.

// select all bridge elements which are descendant of divs $("div span")


jQuery kid selector Example
The kid selector is similar to descendant selector but it alone render the straight child. It has format of $(parent > child) , for example $("div > span") volition render all bridge which are straight kid of div elements.

// select all <b> elements which are straight kid of <p> $("p > b")


jQuery pseudo shape selector Example
The :even,  :odd, :checked are examples of pseudo selectors, they are non portion of CSS specification but extension of jQuery to supply convenience e.g. you lot tin occupation :even to select fifty-fifty elements (zero indexed) e.g. fifty-fifty rows inwards tabular array to mode them differently. Similarly, :odd tin live on used to select :odd elements inwards DOM tree as well as :checked tin live on used to discovery banking enterprise check elements e.g. checked radio buttons or banking enterprise check boxes. See jQuery inwards Action to acquire to a greater extent than how pseudo selector plant inwards jQuery.

// alter the background color of fifty-fifty rows $( "tr:even" ).css( "background-color", "#bbf" );  // alter the background color of strange rows $( "tr:odd" ).css( "background-color", "#bb0" );



jQuery multiple selector Example
The multiple selector is zippo but combining to a greater extent than than 1 selector inwards unmarried search e.g. $(selector1, selector2, selector3) is a multiple selector which selects the combined results of all the specified selectors. For example, $( "div, span, p" ) volition select all div, span, as well as p elements from the DOM. Remember, private selectors are separated past times comma.

//select all div as well as span $( "div, bridge )


jQuery non selector Example
The :not() jQuery selector selects all elements except the specified element. This is to a greater extent than oft than non used together alongside approximately other selector to select everything except the specified chemical constituent inwards a grouping e.g. select all checkboxes which are unchecked, or select the input types which are empty.  See jQuery:Novice to Ninja to acquire to a greater extent than most how to occupation non selector inwards JavaScript

// select all checkboxes which non checked $(input[type=checkbox]:not(:checked))


jQuery all selector Example
The all or universal selector is used to select all elements e.g. $(*) volition select all elements from HTML page. This is useful when you lot desire to apply a mode to all elements of HTML page. Btw, exactly live on careful The all, or universal, selector is extremely slow, except when used past times itself.

// select all HTML elements $(*)


jQuery has selector Example
The :has() selector selects all elements that accept 1 or to a greater extent than elements within of them, that matches the specified selector. For example $("b:has(h1)") will select all <b> elements than accept <h1> chemical constituent within of them.

// select all p which has bridge nether it $("p:has(span)")




That's all most 10 examples of jQuery selectors for spider web developers. I am certain you lot accept learned a duo of novel things today. Though most of them times you lot would discovery yourself using exactly shape as well as id selector, knowing dissimilar types of selector volition assistance you lot to occupation jQuery to a greater extent than effectively. Always recollect to occupation the most specific selector to gain the best functioning from jQuery. For example, using input[type=radio]:checked is to a greater extent than specific than exactly using :radio :checked.


Related jQuery tutorials you lot may like
  • How to acquire electrical flow URL, Parameters as well as Hash using jQuery? (solution)
  • How to occupation to a greater extent than than 1 jQuery UI DatePicker inwards JSP page? (example)
  • How to practise tab-based UI using jQuery? (example)
  • How to redirect a page URL using jQuery as well as JavaScript? (solution)
  • How to write HelloWorld inwards jQuery? (solution)
  • 5 Books to acquire jQuery for Web developers (books)
  • How to charge jQuery inwards a spider web page? (solution)
  • Difference betwixt jQuery document.ready() as well as JavaScript window.onload event? (answer)

Further Reading
The Complete jQuery Course: From Beginner To Advanced!
Up as well as Running alongside jQuery
jQuery Fundamentals By Dan Wahlin


Saturday, November 9, 2019

99 Angular Js Interview Questions For Javascript Spider Web Developers

The AngularJS is 1 of the pop JavaScript frameworks, I shout upward most pop afterwards jQuery, amongst the marrow finish of simplification. It allows edifice dynamic, unmarried page spider web apps (SPAs) using JavaScript together with supports the Model View Controller (MVC) programming structure. It has used widely together with fifty-fifty big companies similar Google, Virgin America, together with HBO are using Angular JS to create their site. The need for spider web developers is on all fourth dimension high together with at that topographic point is a huge need for developers who sympathize modern JavaScript frameworks e.g. Angular JS, jQuery, Facebook's React JS etc. The Angular JS is Open-source, front-end JavaScript framework which is developed past times Google, it mainly competes amongst Facebook's ReactJS framework.

AngularJS handles the heavy lifting of DOM manipulation together with AJAX mucilage that 1 time had to hold out coded from scratch together with encourages the developer to work modular edifice blocks of JavaScript code that tin flame hold out categorized together with are slow to test. You tin flame add together Angular JS to whatever HTML page using <script> tag.

If y'all are preparing for spider web developer interview together with Angular JS is mentioned inwards the Job description together with then y'all volition discovery the next listing of Angular JS interview questions useful. These are about of the ofttimes asked Angular JS Interview questions which bring been asked likewise many JavaScript developers together with it covers all of import topics of Angular JS. You tin flame work this listing to chop-chop banking concern check your grooming or to larn an thought of what to hold back on a JavaScript or Angular JS interview.



Angular JS Interview Questions

1) What is Angular JS framework? What are about of import features of Angular JS?

2) Why should y'all work Angular JS over ReactJS?

3) What is the deviation betwixt MVVM together with MVC together with MVP?

4) What is a unmarried page application? How tin flame 1 create a single-page application using AngularJS? Which provider is used to accomplish this objective?

5) How does Angular JS application bootstrap?

6) How to manual bootstrap AngualrJS?

7) AngularJS Initialization & rendering process?

8) What is the execution social club of Controller, Filters, Service, Factory, Config together with Run inwards Angular JS?

9) What is the deviation betwixt jqLite vs jQuery?

10) What are dissimilar types of binding inwards Angular JS?

11) What is two-way information binding inwards Angular JS?

12) What is ng-model directive inwards AngularJS?

13) Why ng-init is used inwards Angular?

14) Difference Between expression{{}} together with ng-bind inwards AngularJS?

15) What is the work of ng-repeat inwards Angular?

16) What if a duplicate chemical cistron inwards ng-repeat?

17) How to display unique chemical cistron inwards ng-repeat?


18) How to apply switch illustration inwards Angular JS?

19) What is the deviation betwixt service together with manufacturing works life inwards AngularJS?

20) Is service together with manufacturing works life singleton object?

21) How angular has to implement singleton designing inwards manufacturing works life together with service?

22) One scenario where services can't hold out used?

23) What is the important of # inwards the URL?

24) Explain UI Routing inwards AngularJS?

25) Abstract dry soil inwards UI routing?

26) What is the deviation betwixt ng routing vs UI routing inwards Angular?

27) Authorization inwards ng-routing?

28) What is the deviation betwixt range together with $scope?

29) Explain about benefits of controller As?

30) Explain Lazy loading of controllers?

31) How to banking concern check electrical flow running controller?

32) Communication betwixt 2 controllers

33) What are the ajax calls?

34) What are asynchronous means?

35) What are promises inwards Angular JS?

36) What are interceptors inwards Angular JS?

37) What is dependency injection? How to add together a dependency inwards angular?

38) What is digest cycle together with how y'all tin flame halt it?

39) How to banking concern check digest cycle is inwards progress?

40) What is $destroy?

41) What is ng-transclude?

42) How y'all tin flame all method of a controller inwards the directive ?

43) Different types of directives?

44) Controller vs link inwards the directive ?

45) Pre-link vs Post Link vs Compile functions?


46) What is the best way to manipulate DOM together with how tin flame nosotros do?

47) Directive trammel type?

48) Events inwards angular?

49) Restrict types inwards angular?

50) Custom exceptions inwards angular?

51) Filters inwards angular?

52) The custom filter inwards angularjs?

53) What are decorators?

54) Providers inwards angular?

55) Session management inwards angular?

56) Explain Authentication together with Authorization inwards angualrjs?

57) What is localization? How tin flame nosotros accomplish the localization?

58) What is local Storage?

59) What is session storage?

60) What is the deviation betwixt the local Storage together with Session Storage?

61) How to speed upward rendering UI?


62) The directory construction of angular js app?

63) Can y'all explicate about Best practices of Angular JS?

64) How to take ng-classes together with directive information from DOM?

65) What is angular 2?

66) What is the deviation betwixt Angular JS 1.x together with 2?

67) How Angular 2 is rendering DOM?

68) What is a grunt? Why nosotros work it?

69) Why nosotros work grunt other than minification?

70) What is gulp?

71) What are the novel things inwards available inwards html5?

72) What is Two way binding inwards Angular JS?

73) What is Ng-Bind inwards Angular JS?

74) What is One-way binding



75) Directives types

76) Difference betwixt $http vs $resource inwards Angular JS?

77) Explain Dependency injection In Angular JS

78) Explain Methods of $http service

79) How to initiate angular data

80) How create y'all unit of measurement exam an AngularJS filter?

81) What should hold out the maximum position out of concurrent "watches? How would y'all continue an oculus on that number?

82) How create y'all portion information betwixt controllers inwards Angular JS?

83) What is the deviation betwixt ng-show/ng-hide together with ng-if directives?

84) What is a digest cycle inwards AngularJS?

85) Should y'all work AngularJS together amongst jQuery?

 The AngularJS is 1 of the pop JavaScript frameworks 99 Angular JS Interview Questions for JavaScript Web Developers

86) How would y'all specify that a range variable should bring onetime binding only?

87) Explain how $scope.$apply() works?

88) Does angular.copy() method deep re-create or shallow copy?

89) When should y'all work an attribute versus an chemical cistron inwards Angular JS?

90) How create y'all reset a $timeout, $interval(), together with disable a $watch()?

91) Explain what is a $scope inwards AngularJS?

92) What is a singleton designing together with where nosotros tin flame discovery it inwards Angularjs?

93) What is an interceptor? What are mutual uses of it?

94) How does interpolation, e.g. "{{ someModel }}", genuinely work?

95) What is $rootScope together with how does it relate to $scope?
Answer: The $rootScope is the bring upward object of all $scope Angular objects created inwards a spider web page.

96) Explain the role of $routeProvider inwards AngularJS?

97) How create y'all enshroud an HTML chemical cistron via a push click inwards AngularJS?

98) How create y'all disable a push depending on a checkbox’s dry soil inwards Angular?

99) How would y'all implement application-wide exception treatment inwards your Angular app?


That's all close about of the frequently asked Angular JS Interview Questions. You mightiness bring seen many of these questions already on your interview, every bit it contains questions from both telephonic together with face-to-face interviews. This listing of questions is practiced to banking concern check your preparation. If y'all tin flame response all of these questions inwards special together with then y'all are practiced for the Angular JS project interview. You tin flame also work this listing to laid upward for the topics together with explore Angular JS inwards detail.

Reference
https://angularjs.org/
https://docs.angularjs.org/api
Angular five - The Complete Developer Guide
AngularJS inwards Action
Pro AngularJS past times Adma Freeman

5 Ways To Redirect A Spider Web Page Using Javascript Together With Jquery

When an HTTP asking for i page automatically goes to unopen to other page in addition to then it is called a redirection. The redirection of a spider web page is used for different reasons e.g. redirecting to a different domain e.g. when y'all deed your website from i URL to unopen to other URL or redirecting to a to a greater extent than recent version of a page y'all are looking at it. There are many ways to redirect a spider web page in addition to different spider web technologies render different ways e.g. Java provides sendRedirect() in addition to forward() method for redirection. The redirection tin besides hold upward divided into 2 categories, customer side in addition to server side. In customer side, redirection customer is responsible for routing asking to unopen to other URL but inwards server side redirection, its server's chore to redirect to a novel page.

The jQuery in addition to JavaScript are by in addition to large used for customer side redirection in addition to in that location are a break of ways to redirect a spider web page using JavaScript In this tutorial, we'll attempt unopen to of the most pop in addition to mutual ways to redirect a spider web page using JavaScript in addition to jQuery.



How to redirect a spider web page using JavaScript

Before looking at the jQuery code, let's kickoff larn how to redirect a spider web page past times using evidently JavaScript. It provides several uncomplicated ways to accomplish this task without loading an external JavaScript library similar jQuery.


Redirection using window.location.href of Javascript

The most mutual way to redirect an URL using JavaScript is merely setting the href attribute of the window.location object. This simulates normal navigation to a novel page. I don't think whatever task tin hold upward simpler than this, merely assign a novel URL. For example, if y'all are redirecting URL Influenza A virus subtype H5N1 to URL B in addition to then merely seat the URL B hither equally shown inwards the next example:


window.location.href="http://newURL.com";


Tip: You should cry back that window.location.href loads page from browser's cache in addition to does non ever post the asking to the server. So, if y'all accept an one-time version of the page available inwards the cache in addition to then it volition redirect to in that location instead of loading a fresh page from the server.


Redirection using replace() function

Another way to redirect to a spider web page inwards jQuery is past times using the replace() business office of the window.location object. This method removes electrical current URL from the history in addition to replaces it amongst a novel URL. Here is an instance of how to exercise this business office for redirection:

window.location.replace("url"); 


Tip: Use the replace() method if y'all desire to desire to redirect to a novel page in addition to don't allow the user to navigate to the master copy page using the dorsum button.



Redirection using window assign() function

You tin besides exercise the window.location.assign() business office to redirect a spider web page using JavaScript. This business office adds novel URL to the history stack in addition to redirected to the novel URL, which means, dissimilar replace() business office y'all tin exercise the dorsum push to become dorsum to the master copy document. Here is how y'all tin exercise this method to redirect to a novel url

window.location.assign("url"); 

Tip: Use the assign() method for redirection if y'all desire to allow the user to exercise the dorsum push to become dorsum to the master copy document.


Redirection using navigate function

This business office is same equally window.location="url" in addition to it besides loads the page from the cache instead of take requesting it from the server. Here is an instance to exercise the navigate() business office for redirection to a novel page

window.navigate("page.html");

This code is similar to the kickoff method in addition to the page volition hold upward loaded from the cache if available instead of sending a novel asking to the server.



How to redirect spider web page using jQuery

The jQuery API besides allows y'all to redirect a spider web page to unopen to other URL inwards merely i trace of piece of employment of code. Though this is non the ideal way of using jQuery in addition to but since nosotros all exercise jQuery for different needs inwards a spider web project, it makes feel to leverage it for whatever characteristic nosotros can. You tin exercise the attr() business office of jQuery to redirect a spider web page equally shown below:

var url = "http://google.com"; $(location).attr('href',url);

There is a slight departure inwards using attr() vs window.location.href of JavaScript. The $(location).attr('href', url) volition asking a fresh page from server, land window.location.href loads pages from cache.

Here is a consummate spider web page which redirects to unopen to other URL using jQuery:

<html>    <head>       <title>How to redirect a webpage using jQuery</title>    </head>    <body>       <h2>Redirecting to unopen to other URL ..</h2>        <script src="http://code.jquery.com/jquery-1.6.2.min.js"></script>       <script>          $(document).ready(function() {                     var url = "http://javarevisited.blogspot.com";           $(location).attr('href',url);                    });       </script>    </body> </html> 

in addition to hither is the output of this spider web page when y'all run it on a spider web browser e.g. mesh explorer, chrome or edge:

 When an HTTP asking for i page automatically goes to unopen to other page in addition to then it is called a  five ways to redirect a spider web page using JavaScript in addition to jQuery


You tin encounter that page is redirecting, i time the redirect volition hold upward complete, the URL in addition to page championship volition besides hold upward replaced past times the target URL.  See Head First jQuery to larn to a greater extent than virtually jQuery in addition to its powerful API.



How to redirect to the previous page

Another instance of redirection is going to the previous page, hither are unopen to of the mutual way to become to the previous page using JavaScript's window object:

window.history.back(); // Simulates a dorsum push click window.history.go(-1); // Simulates a dorsum push click window.history.back(-1); // Simulates a dorsum push click

All iii methods imitate a dorsum push click programmatically. You tin exercise whatever of the methods y'all desire to use.


That's all virtually how to redirect a spider web asking to unopen to other spider web page using JavaScript in addition to jQuery. As y'all accept seen in that location are multiple ways to redirect but in that location is subtle differences betwixt them e.g. $(location).attr('href', url) telephone weep upward of jQuery volition opened upward a fresh page from the server, but the Javascript window.location.href loads pages from cache. Similarly, the window.location.assign(url) adds novel URL to the document history in addition to redirected to the novel URL but window.location.replace("URL") removes electrical current URL from history in addition to replaces it amongst a novel URL.

Further Reading
The Complete jQuery Course: From Beginner To Advanced!
Up in addition to Running amongst jQuery
books)
  • How to acquire electrical current URL, Parameters, in addition to Hash using jQuery? (solution)
  • How to alter to a greater extent than than i chemical gene inwards i line? (example)
  • jQuery Hello World Example (program)
  • Free jQuery eBooks in addition to PDFs (download)
  • How to exercise to a greater extent than than i jQuery UI DatePicker inwards JSP page? (example)
  • How to create tab-based UI using jQuery? (example)
  • Top xx jQuery Interview Questions for Java Web Developers (list)
  • How to check/uncheck checkboxes inwards jQuery (solution)
  • How to download jQuery dynamically inwards a spider web page? (solution)

  • Thanks for reading this article. If y'all similar this article in addition to then delight portion amongst your friends in addition to colleagues. If y'all accept whatever interrogation or feedback in addition to then delight drib a comment.

    Thursday, October 31, 2019

    Top Eight Websites To Larn Javascript Online - Best Of Lot

    We alive inward a globe of the internet, which is total of resource. You tin terminate acquire whatever you lot desire as well as that too, without spending also much money. If you lot desire to acquire JavaScript, at that topographic point are enough of websites where you lot tin terminate learn JavaScript online for FREE. You don't demand to pay whatever fees, but you lot must receive got a skilful mesh connectedness to accept total payoff of these online resources. Out of thus many websites which offering complimentary tutorials, articles, spider web log post, videos, as well as podcasts, I receive got chosen these half dozen websites to recommend to anybody who wants to acquire JavaScript.

    I am a Java developer, but I receive got learned JavaScript past times next this tutorial, Why? Because I commonly receive got to piece of employment on Java-based spider web application which uses Servlet as well as JSP for server-side scripting, but nosotros ever usage JavaScript as well as jQuery for client-side scripting.

    In recent years, frameworks receive got changed, as well as from jQuery, nosotros are shifting to to a greater extent than powerful frameworks similar Vue.js but i affair has remained common, the JavaScript as well as thus is my shout for to cash inward one's chips a ameliorate JavaScript developer.

    I would hold upward outset to acknowledge that my JavaScript skills are non every bit skilful every bit Java as well as that's why I am ever inward search of closed to skilful resources to continue acquire as well as refresh whatever I receive got learned online on JavaScript past times next tutorials as well as these interactive websites.

    In this article, I am going to portion closed to of the websites I receive got used to acquire JavaScript online. These are corking websites, as well as you lot volition discovery a lot of resources to acquire JavaScript or improve your JavaScript as well as Web Development skills.

    I receive got included both complimentary as well as paid resources thus that you lot tin terminate select whatever you lot like, but i affair is mutual that all of them are corking JavaScript resources.





    8 Great Websites to Learn JavaScript Online

    Here is my curated listing of half dozen websites to acquire JavaScript online for FREE. It includes interactive websites, official resource, skilful books, as well as other resources.


    1. udemy.com
    One of the best house for online learning. You volition acquire online courses inward all the latest engineering as well as programming language, similar Java, Spring, Selenium, REST.

    It provides both complimentary as well as paid resources. The paid resources are also real cheap, as well as you lot tin terminate buy on only $9.99 during their flash sale, which happens quite often.

    There are a lot of corking JavaScript courses you lot volition discovery inward this site both complimentary as well as paid, but if you lot inquire my recommendations, I suggest The Web Developer Bootcamp course of pedagogy past times Colt Steele. It non only covers JavaScript but also all other things you lot demand every bit a spider web developer.



    If you lot demand to a greater extent than choices, you lot tin terminate also explore this listing of free JavaScript courses from Udemy.




    2. Java, Git, Linux ascendency line as well as several other courses, it made its refer past times an interactive JavaScript course of pedagogy to acquire online at your ain pace.

    You tin terminate guess the popularity of this course of pedagogy past times looking at the divulge of students enrolled, currently 5M+, which is the real high divulge for whatever online FREE course.

     You tin terminate acquire whatever you lot desire as well as that also Top 8 Websites to Learn JavaScript Online - Best of Lot

    In short, Code Academy is the best website to acquire JavaScript online, as well as you lot should accept payoff of this.



    4. code combat
    JavaScript tin terminate hold upward a fairly slowly agency to add together added functionality to your spider web page, but learning JavaScript on your ain tin terminate hold upward a daunting task. CodeCombat is a platform for students to acquire calculator scientific discipline spell playing through a existent game.

    All courses receive got been specifically playtested to excel inward the classroom, fifty-fifty past times teachers amongst piddling to no prior programming experience.

     It has closed to web evolution courses to acquire the basics of JavaScript.




    In short, a website to a greater extent than suitable for beginners as well as students. You tin terminate acquire the basics of JavaScript fairly speedily past times next their unique style.




    5. code avengers
    This is closed to other corking website to acquire programming engineering interactively amongst a lot of fun. The Code Avengers provides a twain of JavaScript classes of dissimilar level, e.g. JavaScript 1 which covers if statements, loops, as well as variables. JavaScript 2 which explains String, function, Math as well as Arrays as well as to a greater extent than advanced JavaScript iii which teaches Events, Animations, GUIs, as well as Classes.


    In short, a to a greater extent than structured agency to acquire JavaScript online. You tin terminate select the courses depending upon your sense as well as how much you lot already know near JavaScript. Suitable for both intermediate as well as experienced JavaScript developers.



    5. code school
    This i is closed to other website which I actually love. Their jQuery tutorial is actually great, but JavaScript course of pedagogy is also non far behind as well as gives you lot existent direct chances to acquire JavaScript online for FREE at your ain pace. Similar to CodeAcademy, CodeSchool also offers an interactive tutorial, but it's to a greater extent than fun every bit you lot acquire marks, badges, as well as cross levels.



    This is i time again, i of the best resources to acquire JavaScript online. It's interactive, interesting as well as at the same fourth dimension non-trivial.



    6. Mozilla
    Mozilla is for the serious learner, a programmer who loves to produce their ain materials as well as only desire to read the theory as well as endeavor examples inward their ain setup. Unlike CodeAcademy as well as CodeSchool, this is non interactive, but you lot volition discovery detailed information. Mozilla is also the official source for whatever JavaScript information.




    I usage this site every bit reference documentation for many JavaScript, it contains a wealth of information, as well as you lot tin terminate produce the same too.




    7. code mentor
    Another corking site which provides interactive JavaScript tutorial. This website provides a 4-week course of pedagogy to acquire JavaScript, inward fact, to master copy JavaScript, every bit the course of pedagogy claims.

    You volition non exclusively acquire near total JavaScript but also near other famous JavaScript library as well as related concepts, e.g. ajax, json, jquery, angular, react, as well as more.




    8. Educative
    This is closed to other corking online course of pedagogy website which focuses on interactive learning past times non leaving the traditional approach of theory as well as practice. There are a lot of skilful courses on this website, both complimentary as well as paid, as well as you lot tin terminate explore to discovery the correct JavaScript course of pedagogy for you.

    But, if you lot inquire my recommendations, I advise you lot bring together the Step Up Your JS: Influenza A virus subtype H5N1 Comprehensive Guide to Intermediate JavaScript course of pedagogy past times Arnav Aggarwal. This course of pedagogy covers all the things you lot demand to know every bit a JavaScript developer as well as also to clear upward whatever interview.




    That's all near these best websites to acquire JavaScript online. If you lot are serious near learning JavaScript as well as then you lot must non only sit down dorsum as well as relax but also start developing closed to real-world project, start using pop JavaScript library similar React, Vue.js, as well as Node JS to cash inward one's chips proficient inward what manufacture is expecting from a JavaScript Developer.

    If you lot similar to majority to a greater extent than than websites, as well as then you lot also start amongst reading Head First JavaScript, i of the best books to acquire JavaScript from scratch.

    Btw, If you lot mean value at that topographic point is closed to other Website which is a corking resources to acquire JavaScript online as well as for FREE, as well as then delight advise it inward the comments section, I would hold upward happy to include that on this list.


    More Programming as well as Web Development articles you lot may like
    • The 2019 Frontend as well as Developer RoadMap (guide)
    • 5 Courses to acquire React framework (courses)
    • The 2019 DevOps Developer RoadMap (guide)
    • 5 Great websites to acquire SQL for FREE (see here
    • 5 Free Courses to acquire Angular 2+ online (courses)
    • Top v Courses to acquire Node.js for a spider web developer (courses)
    • 10 Frameworks Fullstack Engineer tin terminate acquire inward 2019 (full-stack)
    • The 2019 Reactjs Developer RoadMap (guide)
    • 10 Tools every Programmer should acquire (tools)
    • 10 Java as well as Web Development frameworks to acquire inward 2019 (frameworks)
    • Top v JavaScript courses for curious developers (courses)
    Thank you lot for reading this far, if you lot receive got whatever questions or feedback, as well as then delight drib a comment. If you lot similar this article as well as books, as well as then delight portion it amongst your friends as well as colleagues. 

    Have a dainty twenty-four hours ahead, Happy Learning JavaScript :)

    P. S. - If you lot desire to cash inward one's chips a spider web developer inward 2019, you lot tin terminate also encounter this 2019 Web Developer RoadMap on HackerNoon to discovery out which frameworks, libraries, tools, as well as technologies you lot demand to acquire to cash inward one's chips the Web developer you lot ever wanted to be.

    Saturday, March 12, 2011

    Top Five Gratuitous Courses To Acquire Nodejs Inwards 2019 - Best Of Lot

    Node JS has completely changed the way JavaScript is used for development. Earlier JavaScript was considered every bit a client-side linguistic communication because it runs on a browser together with generally used for client-side validations, animations, together with interaction. Node.js takes that to the adjacent marking past times allowing JavaScript to run on a server-side, which agency y'all tin forcefulness out straightaway write JavaScript applications which tin forcefulness out execute without a browser. Node JS uses Google Chrome's execution engine together with asynchronous processing to create this. All y'all demand to is include node.js script inward your application, together with y'all are prepare to create server-side applications inward JavaScript, which wasn't possible until a few years back.

    Node.js has also played an essential role inward doing full-stack evolution using only i programing linguistic communication because straightaway it's possible for a JavaScript developer to create an end-to-end spider web application using Node.js together with React.js or whatever stack they want. Bottom trouble is they volition last using JavaScript on both the customer together with server-side.

    Because of the immense popularity of Node.js together with JavaScript, many programmers are also learning JavaScript together with Node.js framework to exceed away a spider web developer, mainly a full-stack developer together with that's where these online courses aid a lot.

    In the past, I own got shared some of the best Node.js online courses for Web developers which many of my readers liked a lot together with appreciate it, but some of them also asked virtually the gratis choice of those paid courses thus that they start without investing whatever money.

    Thankfully, the meshwork is total of splendid gratis resources, together with I also encourage y'all to acquire from them. They are non alone best to acquire an thought of what is node.js together with how it helps y'all to create a server-side application inward JavaScript but also tin forcefulness out learn y'all all the nitty-gritty of node.js together with walk y'all through creating an end-to-end application.

    Even though I am a nerd together with own got read hundreds of books, online courses own got changed the way I acquire novel technologies. Now I start amongst a class, acquire the basics similar setting upwards my dev environment, together with writing my starting fourth dimension few programs. Once I acquire the hang of technology, I follow-up amongst a majority to farther consolidate together with acquire that inward depth.

    I'll part the Node.js books later, but this is the fourth dimension for some of the best gratis online Node.js courses from Coursera, Udemy, Pluralsight, together with edx.org to kick-start your Node.js evolution journey. Btw, If y'all don't hear paying a few bucks for learning something every bit valuable every bit Node.js together with thus I also advise y'all banking concern check out The Complete Node.js Developer course by Andrew Mead together with Rob Percival, i of the best class to self-taught Node.js yourself.





    Top v Free Courses to Learn Node.js for Beginners

    These courses focus on Node.js basics together with fundamentals together with some hands-on coding. If y'all already know Node.js, y'all may uncovering them a flake repeating, inward that case, I advise y'all own got some advanced Node.js courses I own got shared earlier.

    Without wasting whatever to a greater extent than of your time, hither is my listing of some of the splendid gratis Node.js courses which y'all tin forcefulness out own got online at the comfort of your business office together with home. I own got hand-picked these Node.js class for beginners.


    1. Node JS API Development for Beginners
    This is i of the best Node JS beginner class y'all tin forcefulness out acquire online. In this course, y'all volition acquire Node JS API Development from absolute scratch.

    This class is similar consummate beginners getting started guide, every bit y'all volition start from what is node js together with why acquire node.js to installing node js dev environs together with sympathise how JavaScript executes inward a browser together with a non-browser background.

    In this course, y'all volition acquire Modern JavaScript, Node JS final result loop, Asynchronous programming, using node modules, npm modules together with creating your ain modules, creating a server, connect to the database together with sending json responses.

     Node JS has completely changed the way  Top v Free Courses to acquire Nodejs inward 2019 - Best of lot

    It has a actually squeamish mix of theory together with hands-on practice, which is really hard to brand it a gratis course. Talking virtually social proof, to a greater extent than than 11,605 students own got already benefitted from this, together with it has, on average, 4.3 ratings from to a greater extent than or less 500 participants. Influenza A virus subtype H5N1 big cheers to teacher Ryan Dhungel for creating this class together with making it gratis for learners.


    2. Server-side Development amongst NodeJS, Express, together with MongoDB
    This is some other gratis Node.js class from Coursera, my favorite site for online learning from a reputed institution. This class is also offered past times The HongKong Univerity of Science together with Technology.

    The class starts amongst a brief overview of the Web protocols similar HTTP together with HTTPS together with and thus explains what NodeJS together with NodeJS modules similar Express for edifice spider web servers are.

    On the database side, y'all volition review basic CRUD operations, NoSQL databases, inward particular, MongoDB together with Mongoose for accessing MongoDB from NodeJS.

    After that, y'all volition acquire basic REST concepts together with how to create a RESTful API amongst authentication together with safety features. Finally, y'all volition acquire virtually backend every bit a service (BaaS) approaches, including mobile BaaS, both open-source together with commercial BaaS services.

    This class is also portion of Full-Stack Web Development amongst React. If y'all don't know, Influenza A virus subtype H5N1 Specialization is a serial of classes that aid y'all master copy a skill. When y'all consummate this course, your progress volition count towards your learning inward this Specialization.



    Like many Coursera courses, this is also free-to-audit, which agency y'all tin forcefulness out access the class for gratis but won't acquire a certificate or grading. If y'all demand a license, together with thus y'all demand to pay for that together with consummate the other courses on Specialization which also contains a project, perfect for some real-world experience.


    3. Introduction to NodeJS
    This is some other splendid gratis class to acquire Node.Js from Microsoft together with edX. The ultimate beginner guide to creating spider web applications using Node.js, Express, together with MongoDB.

    In this gratis Node JS course, y'all volition acquire the basics of Node.js together with its essence modules. You volition also acquire how to import additional modules together with configure your projection using the npm.

    From there, y'all volition come across how to usage Express to laid upwards a spider web server together with how to interact amongst a MongoDB database using Mongoose.

    By the terminate of the course, y'all volition own got created several real-world projects such every bit a spider web scraper, a blogging API, together with a database migration script using node.js. Overall, a perfect node.js beginner course to kick-start your journey.

     Node JS has completely changed the way  Top v Free Courses to acquire Nodejs inward 2019 - Best of lot



    4. Intro to Node JS & Express
    This is some other introductory gratis class on Node JS together with Express for beginners. The class is really informative together with takes a step-by-step approach to learn Node JS together with Express. The 10-part serial covers:
    • Project Structure
    • Static Assets
    • Templating Engines
    • Dynamic Requests
    • Handling POST data
    • Rendering Dynamic Data
    • Styling together with Images
    • Middleware
    • Deployment

    By the terminate of this series, y'all volition sympathise the basics of a Node/Express projection together with last able to deploy a full-functional spider web app. I would highly recommend this class if you're a beginner inward the NodeJS together with Full Stack development.



    5.  Node JS has completely changed the way  Top v Free Courses to acquire Nodejs inward 2019 - Best of lot


    Btw, if y'all don't own got a membership together with thus also y'all tin forcefulness out acquire access to this class past times signing upwards for their Top v Course to acquire Web Development
  • How to Become a Web Developer inward 2019
  • The 2019 React Developer RoadMap
  • It's Never besides belatedly to acquire Web Development.
  • The Web Developer Roadmap (Frontend + Backend)
  • 5 Free HTML together with CSS Course for Web Developers
  • 10 Java together with Web Development Courses for Programmers
  • 10 Things Every Software Engineer Should Learn
  • 10 Frameworks Java together with Web Developers Can Learn inward 2019
  • Thanks for reading this article thus far. If y'all similar these gratis Node JS courses, together with thus delight part amongst your friends together with colleagues. If y'all own got whatever questions or feedback, together with thus delight driblet a note.

    P.S. - If y'all don't hear paying a few bucks for learning something every bit valuable every bit Node.js together with thus I also advise y'all banking concern check out The Complete Node.js Developer course past times Andrew Mead together with Rob Percival, i of the best class to acquire Node js online.