Menu

Friday, October 1, 2021

Add Event listener on elements(li or multiple values ) using parent element and passing event,"selector" parameter.

HTML

<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Practice HTML</title>
    <link rel="stylesheet" href="/Miscellenious/practice.css">
    <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.2.1/jquery.min.js"></script>
    <script src="/Miscellenious/practice.js"></script>
   
</head>
<body>
    <ul>
        <li>1</li>
        <li>2</li>
        <li>3</li>
        <li>4</li>
        <li>5</li>
        <li>6</li>
        <li>7</li>
        <li>8</li>
    </ul>
  
    
</body>
</html>

Why and when is document.ready() needed

$(document).ready is for assurance full DOM is available at the time the function is called. Any functions and events not depending on the DOM don't need to be put into the ready event.

Well, 

what if we load dom and css first and javascript at the end(just before /body element)

HUUUU.. 

$(document).ready(function(){}); NOT NEEDED

So Check first , In html where is the javascript reference if it's in <head> you must use ready()
but if just before</body> you can skip utilizing ready()

Check it out :

Target Server Side implementation using .net SDK

 Target Server Side implementation using .net SDK  This reference guide shows how Adobe Target customers can install, initialize, and use th...