Skip to main content

Posts

Showing posts from July, 2022

DOM Traversal Method in javascript

  Tree Example <! DOCTYPE html > < html >     < head >         < title > DOM Navigation </ title >     </ head >     < style >         #outer {             width : 800px ;             height : auto ;             border : 1px solid black ;             margin : 150px auto ;             padding : 10px ;             border-radius : 1rem ;         }         #inner {             width : 600px ;             height : 200px ;             border : 1px solid black ;             border-radius : 1rem ;             m...

DOM addEventListeners in javascript

  <! DOCTYPE html > < html >     < head >         < title > DOM Add Event Listeners </ title >                 < style >         .abc {             text-transform : uppercase ;                 }         .outer {             width : 200px ;             height : 200px ;             background-color : aqua ;         }         .inner {             width : 100px ;             height : 100px ;             background-color : blueviolet ;             margin : 30px auto ;                 ...

DOM cssStyle Methods in Javascript

  <! DOCTYPE html > < html >     < head >         < title > DOM CSS Style Methods </ title >                 < style >         .abc {             text-transform : uppercase ;                 }         </ style >     </ head >         < body >         < h1 id = "heading" class = "title" style =" color : indigo ; font-weight : lighter ;" > DOM CSS Style Methods </ h1 >         < p class = "para" > There are three methods </ p >         < ol >             < li > Style </ li >             < li > className </ li >           ...

DOM querySekector in Javascript

  <! DOCTYPE html > < html >     < head >         < title > Dom Set and Get Methods </ title >     </ head >     < body >         < h1 id = "heading" class = "title" > Dom Query Selector Methods </ h1 >         < h3   class = "title" > Dom Query Selector All Methods </ h3 >         < p > There are the different Objects use to targer DOM ekement </ p >         < ol >             < li > Id : document.getElementById(id) </ li >             < li > Class Name : document.getElementsByClassName(class) </ li >             < li > Tag Name : document.getElementsByTagName(tag) </ li >         </ ol >       ...

Javascript Basic Events

 

Dom Set and Get Methods in javascript

  <! DOCTYPE html > < html >     < head >         < title > Dom Set and Get Methods </ title >     </ head >     < body >         < h1 id = "heading" > Dom Set and Get Methods </ h1 >         < input id = "first_name" class = "abc efg" name = "first_name" value = "Adnan" placeholder = "Enter First Name..." style =" border : 3px solid " onclick = " xyz () " />         < script >             // How to get the attribute of elements             // innerHTML: To get the inner html of the element             // innerText: To get the inner text of the element             var element  = document . head . innerHTML ;             console . log ( 'Taget DO...

Get previous route URL and route name in laravel.

  $url = url ()-> previous (); $route = app ( 'router' )-> getRoutes ( $url )-> match ( app ( 'request' )-> create ( $url ))-> getName (); if ( $route == 'RouteName' ) { //Do required things } In blade file @php $url = url ()-> previous (); $route = app ( 'router' )-> getRoutes ( $url )-> match ( app ( 'request' )-> create ( $url ))-> getName (); @endphp @ if ( $route == 'RouteName' ) //Do one task @ else // Do another task @ endif references 1: https://linuxhint.com/laravel-how-to-get-current-route-name/ references 2: https://stackoverflow.com/questions/40690202/previous-route-name-in-laravel-5-1-5-8

How Javascript code works ?

 1.When js code runs it create global execution context. 2.Execution context consist of two part 1) Memmory 2) Code 3.Execition context created in two phases 1) Creation phase also known as the Memory creation phase. 2)Second will be the code exection tion phase. In First Phase Js allocation memory to all the variables and functions. Note: one thimg is here to note js only allocation memory to variables and functions,Not data,values assigned to thes variables. n : undefined square:{ whole code} total : undefined (values will be assign in second code execution phase) In Second Phase js read all code line by line. and assign value to the variables. function invocation:Method which call the function for exection called invocation function. Note: When we invoke a function than brand new execution context is created in the code phase which exectly have save two parts 1)Memory 2) Code.  After the execution ,code complete execution the global context finish at any level. Call statck ...