Javascript Ko Webpage me kaise use kre ?
Javscript ek programming language hai jo dynamic web pages bnane me or webpage me or bhi bhot saari functionality add krne me help krti hai. Wo hum dheere aage pdhenge Or javascript ki ek detailed definition bhi btaenge.
Programming language kya hoti hai ?
hum insaano ko ek dusre se baat krne k liye ya ek dusre ko kch smjhane ki liye kisi language ki jrurat hoti hai. Computer hum insaano ki language nhi smjhta. Wo sirf 0 and 1 ki language smjhta hai or hme 0 and 1 ki language nhi aati. Hum log computer ko apni baat smjha ske uske liye bhot saari labguages bnai gai jaise Javascript, Java, php or b bhot saari. sbhi language same he kaam krti h but unki processing ka tarika thoda alg hota hai. Or yha hum abhi Javascript ki baat kr rhe hai to usi k baare me pdhte hai.
Jb b hum code likhte hai kisi bhi programming language ka use krk wo computer nhi smjh pata. to sbse phle jo humne code likha hai wo machine code (Machine Code ka matlab hai 0 or 1 ki language) me convert hota hai. Kyunki humara computer sirf machine language smjhta hai. To chhahe koi si bhi programming language ho sbse phle jo code humne likha hai wo machine code me convert hoga.
Code ko machine code me convert krne ke 3 tarike hote hai
- Compilation
- Interpretation
- Just-in time compilation
1. Compilation - Compilation Process me code ek bar me pura ka pura machine code me convert ho jata hai. Or uska execution ho skta hai tbhi ho jae or ho skta hai 1 month baad ho.
For Example - Hum abhi humare system me jo b browser use kr rhe hai Chrome/Firefox, uska code kisi developer ne likha hoga or fr uss code ko compile kia hoga machine language me convert krne k liye. Fr uss developer ko ek compiled bundle mila wo usne website pe daal dia. Wo bundle hum humare system me download kr lete hai or fr install kr k use kr lete hai.
2. Interpretation - Interpretation process me humara likha hua code line by line machine code me convert hota hai or tb ki tb execute ho jata hai.
For Example - Jaise hum koi website bnate hai simple HTML/CSS/JavaScript ka use krk, to uss case me hme koi bundle nhi milta code complie hokr. Uski jgh jb b hum humari index file pr click krk webpage open krte hai humara code usi time machine code me convert hota hai or execute ho jata hai.
3. Just-In-Time compilation - just-in-time compilation process mix hai Compilation or Interpretation process ka. just-In-Time comilation process me humare code pura ka pura machine code me convert ho jata hai or uske just baad execute ho jata hai.
Note - Javascript follows the Just-In-Time compilation approach.
Dynamic web pages ka kya matlab hai ?
Jb b hum koi website bnate hai to hme pta hai ki hum phle uska structure bnate hai HTML ka use krk or css ka use krte hai beautiful dikhane k liye. But HTML and CSS hme aisi koi functionality provide nhi krti jiska use krk hum hum decide kr ske ki age user ne kisi button pr click kia h to kaise respond krna hai. Ya agr hme user se koi form bharwana h to user ne shi email ya name dala h or wo data kaise server tk phoche.