Sunday, 13 September 2020

 https://www.youtube.com/watch?v=17Jxds71910 see this video like it and subscribe 

Sunday, 23 August 2020

Code template

       

           ---YOUR CODE HERE--

       
 
how to make Pancake with 18 steps


1.pour a egg into to the bowl.
2.Then put 2 TBSP of sugar.
3.Whisk it nicely.
4.Then add 3/4 cup of milk
5.Whisk it nicely
6.add one cup of all- purpose flour
7.3/4 TBSP of baking powder
8.Sift it
9.Whisk it well
10.add 2 TBSP of cooking oil
11.Whisk it well
12.Heat a non-stick pan
13.pour about 3/4 ladle of the batter onto the pan
14.When edges look dry  and bubbles start to appear,and pop on the top surface
15.cook until lightly brown
16.reapeat the same steps with the remaining batter
17.serve with the butter and maple syrup
18. and your Pancake is ready




Sunday, 5 January 2020

JS simple arrow function

Below is the code for a simple arrow function in javascript
var total =(a,b)=>a+b;
console.log(total(6,20));

Friday, 13 December 2019

JS difer and async script attribute



Following html file through javascript errors when loading.

index,html
       
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
    <script src="script.js"></script>
</head>
<body>
    
</body>
</html>
       
 

script.js
       
  document.body.innerHTML="<h1>Hello world </h1>
 


If you look at the javascript console you can see

TypeError: document.body is null
Live reload enabled.

The javascript is executing before the document is loaded. We can differ the execution of javascipt file loading using difer attribute in script tag. If this tag is present the script will execute after the page is finished parsing.
       
<script src="script.js" defer></script>
 

 In this case the javascript will load only after the document is loaded.

 The attribute async will move the execution of script asynchronously with the rest of the page.
       
<script src="script.js" async></script>
 

You can put the script tag after the body as well.

      
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
    
</head>
<body>
    
</body>
<script src="script.js"></script> 
 </html>