Wednesday, May 11, 2022

JavaScript - Inheritance of Methods and Properties



Selecting Elements

Selection of the elements using document

  • document.documentElement
  • document.head
  • document.body

Query selection

  • document.querySelector(‘.header’) // only select 1 element
  • document.querySelectorAll(‘.section’) // all element with class section
  • document.getElementById(‘section1’) // you can find element by ID
  • document.getElementsByTagName(‘button’) // all element by tag – this is live collection
  • document.getElementsByClassName(‘btn’) // all element have class btn

Creating and Inserting elements

  • .insertAdjacentHTML // use to insert first in element
  • document.createElement(‘div’) // create DOM in javascript, you can append or insert in your page.
  • .prepend() // add element as first child
  • .append() // add element as last child
  • .before() // add before the element
  • .after() // add after the element
  • .remove() // delete the element

Important to know about Class

const logo = document.querySelector(‘.nav__logo’); // element
  • logo.classList.add(‘a’, ’b’) // add class to element
  • logo.classList.remove(‘a’, ‘b’) // remove class
  • logo.classList.toggle(‘c’) // toggle
  • logo.classList.contains(‘c’) // this will check if class is present in the element or not

Monday, May 2, 2022

2 Useful tricks in Windows for Screen Recording and Voice Typing

Recently found 2 useful tricks that help me a lot in my day-to-day work.

1) Instantly record your screen, just press (Win + Alt + R) 

2) Easy to voice type and detect your work, just press (Win + H), and a detecting bar will appear on top. now just talk to your system, and it will type for you.


Hope this will make your life easy.  😉

Retrieve more than 5000 items from SharePoint List

I actually have struggled with masses even as my list is getting large and want to retrieve the rows more than 5K. Here I located the answer is to apply the Recursive call to retrieve more than 5K items.


Here we're doing the recursive call to the GetListItems() function. This will fetch information withinside the bunch of a thousand objects and concatenate it to the response variable.

Here data.d.__next includes the URL to get the next set of items. In case we don’t have more items left to fetch, it'll not call GetListItems() function.


Hope many of us will find this helpful.