jaavaaskript

jaavaaskript ek computer prograaming bhaasha hai. yeh ek skripting bhaasha hai aur mukhyat: klaaent side mein vebapej ke nirmaan mein prayukt hoti hai.

anukram

pramukh visheshataaen

  • jaal prushthon ke gatyaatmak (dynamic) banaane mein upayogi
  • klaaent side mein (prayokta ke computer par) chalti hai.
  • yeh ek intaraprited bhaasha hai.
  • aabjekt oriyented bhaasha hai.
  • ismein pratham shreni ke fanshan hain.
  • jaavaaskript ka sintaiks, si ke sintaiks se prabhaavit hai.
  • jaavaaskript ka vaastavik naam "ECMAScript" hai.

yadyapi iske naam mein jaava shabd aaya hua hai, tathaapi iska jaava naamak prograaman bhaasha se koi sambandh nahi hai. haaain, jaava tatha jaavaaskript dono ka sintaiks, si ke sintaiks se prabhaavit hai. jaavaaskript ki design ke mukhya siddhaant self (Self) naamak prograaming bhaasha se liye gaye hain.

jaavaaskript ke vibhinn upayog

  • jaavaaskript, echateeemael dijaainaron ke liye prograaming ki suvidha pradaan karti hai.
  • jaavaaskript, echateeemael prushthon mein gatisheel tekst (dynamic text) daalne ki suvidha deti hai.

udaaharan:

document.write("<h1>" + name + "</h1>")

uparokt jaavaaskript stetament, kisi HTML pej mein char-paath (variable text) likhne ke liye prayog kiya ja sakta hai.

  • jaavaaskript, ghatnaaon (events) ke anusaar vaanchhit pratikriya karne ke liye upayog ki jaati hai. udaaharan ke liye kisi echateeemael pej ke kisi batan par klik karne par koi poorv-nirdhaarit kaarya karne ke liye.
  • jaavaaskript, elements ko padh ya likh sakti hai. iska arth yeh hua ki kisi HTML pej ke kisi avayav ke baare mein jaankaari praapt karke use badla ya hataaya ja sakta hai. is tarah us pej ko parivrtit kar sakte hain.
  • jaavaaskript, aankadon ki jaaainch-parakh kar sakti hai. kisi firm ke prayokta dvaara us firm mein bhare gaye aankadon ko pehle jaaainch lene ke baad sarvar ke paas bhejane se suvidha ho jaati hai. isse sarvar ka samay bachata hai aur prayokta ko bhi trutiyon ki jaankaari jaldi ho jaati hai.
  • jaavaaskript, kisi pej par aaye aagantuk () ke braaujar ke baare mein jaankaari praapt kar sakti hai. iska upayog karke us braaujar ke anukool samuchit vyavahaar kar sakti hai taaki vah pej sabhi braaujaron mein theek se dikhaaya ja sake.
  • jaavaaskript ka prayog kukki (cookies) ke nirmaan mein kiya ja sakta hai.

jaavaaskript ke avayav

char (vairiyebals)

objekt

jaavaaskript mein har cheej ya to mool maan (primitive value) hota hai ya objekt. जावास्क्रिप्ट का डॉक्युमेन्ट ऑब्जेक्ट मॉडल (DOM)

jaal prushthon ke nirmaan mein jaavaaskript

jaavaaskript ka mukhya upayog aise fanshan likhne mein hota hai jo HTML pejon mein antarnihit (embedded) hote hain. neeche ek udaaharan diya gaya hai jo darshaata hai ki HTML mein jaavaaskript kis prakaar samaahit (include) karte hain.

<!DOCTYPE html>
<html>
 <head><title>simple page</title></head>
 <body>
 <script>
 document.write('Hello World!');
 </script>
 <noscript>
 Your browser does not support JavaScript.
 </noscript>
 </body>
</html>

baahari kadiyaaain