-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit d28cb6b
Showing
7 changed files
with
108 additions
and
0 deletions.
There are no files selected for viewing
9 changes: 9 additions & 0 deletions
9
javascript/2.Javascriptda boshlang'ich ko'nikmalar - kod yozish amaliyoti/1.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
<html> | ||
<head> | ||
</head> | ||
<body> | ||
<script type="text/javascript"> | ||
alert("salom"); | ||
</script> | ||
</body> | ||
</html> |
7 changes: 7 additions & 0 deletions
7
javascript/2.Javascriptda boshlang'ich ko'nikmalar - kod yozish amaliyoti/2.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
<html> | ||
<head> | ||
</head> | ||
<body> | ||
<script type="text/javascript" src="./salom_alert.js"></script> | ||
</body> | ||
</html> |
24 changes: 24 additions & 0 deletions
24
...pt/2.Javascriptda boshlang'ich ko'nikmalar - kod yozish amaliyoti/confirm_and_prompt.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
<html> | ||
<head> | ||
</head> | ||
<body> | ||
<div id="confirm_result"></div> | ||
<div id="demo"></div> | ||
<script type="text/javascript"> | ||
var r = confirm("Click button"); | ||
if (r == true) { | ||
x = "OK!"; | ||
} else { | ||
x = "Cancel!"; | ||
} | ||
document.getElementById("confirm_result").innerHTML = | ||
"Sizning tanlovingiz: " + x; | ||
|
||
var person = prompt("Ismingizni kiriting", "Harry Potter"); | ||
if (person != null) { | ||
document.getElementById("demo").innerHTML = | ||
"Salom " + person + "! Ishlar qanday ?"; | ||
} | ||
</script> | ||
</body> | ||
</html> |
1 change: 1 addition & 0 deletions
1
javascript/2.Javascriptda boshlang'ich ko'nikmalar - kod yozish amaliyoti/salom_alert.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
alert("salom !!!"); |
67 changes: 67 additions & 0 deletions
67
...Javascriptda boshlang'ich ko'nikmalar - funksiya, obyekt va massiv/function_example1.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,67 @@ | ||
<html> | ||
<head> | ||
</head> | ||
<body> | ||
<div> | ||
<h2>Click hodisa</h2> | ||
<img src="pic_bulboff.gif" onclick="changeImage(event)"/> | ||
</div> | ||
<div> | ||
<h2>Hover hodisa</h2> | ||
<img src="pic_bulboff.gif" id="second_light" /> | ||
</div> | ||
<script type="text/javascript"> | ||
// rasm nomi, ushbu misolda rasmlar html file bilan bir joyda turibdi. | ||
var imgOn = "pic_bulbon.gif"; | ||
var imgOff = "pic_bulboff.gif"; | ||
|
||
/* imagening click hodisasi ishlagan payti chaqirilhan funksiya | ||
event haqida batafsil keyingi misolda so'z yuritamiz | ||
bu yerda event shu click bo'lgan image html elementining click hodisasi | ||
*/ | ||
function changeImage(event) { | ||
var image = event.currentTarget; | ||
/* event.currentTarget bu click bo'lgan elementni o'zini qaytaradi */ | ||
|
||
/* if da shu biz click qilgan imagening src attributi | ||
'bulbon' so'zi bor yoki yo'qligiga tekshiryapti, oddiy aytganda: | ||
1 satr ichidan 2-satrni qidirishga misolda. | ||
Nega aynan 'bulbon' ? - chunli etibor bergan bo'lsangiz | ||
yonib turgan (var imgOn) suratning nomida aynan shu so'z bor, imgOff da esa yo'q | ||
*/ | ||
if (image.src.match("bulbon")) { | ||
image.src = imgOff; // surat ochib turgan chiroq surati bilan almashtirilyapti | ||
} else { | ||
image.src = imgOn; // surat yonib turgan chiroq surati bilan almashtirilyapti | ||
} | ||
} | ||
|
||
var secondLight = document.getElementById('second_light'); | ||
|
||
secondLight.onmouseover = mouseOver; // suratning mouseover hodisasiga funksiya bog'lab qo'yildi | ||
secondLight.onmouseout = mouseOut; // suratning mouseout hodisasiga funksiya bog'lab qo'yildi | ||
|
||
function mouseOver(){ | ||
/* console.log("malumot"); yoki console.log('malumot'); - bu dasturchiga yordamchi funksiya | ||
u yordamida siz consolda loglarni chiqarib funksiyalar | ||
qanday ishlayotgani haqida malumotga ega bo'lishingiz mumkin | ||
*/ | ||
//console.log('biron bir xabar'); | ||
console.log('mouse over'); | ||
secondLight.src = imgOn; // surat yonib turgan chiroq surati bilan almashtirilyapti | ||
} | ||
function mouseOut(){ | ||
console.log('mouse leave'); | ||
secondLight.src = imgOff; // surat ochib turgan chiroq surati bilan almashtirilyapti | ||
} | ||
|
||
</script> | ||
<style type="text/css"> | ||
div { | ||
width: 49%; | ||
display:inline-block; | ||
text-align: center; | ||
} | ||
</style> | ||
</body> | ||
</html> |
Binary file added
BIN
+2.43 KB
...ascriptda boshlang'ich ko'nikmalar - funksiya, obyekt va massiv/pic_bulboff.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+2.49 KB
...vascriptda boshlang'ich ko'nikmalar - funksiya, obyekt va massiv/pic_bulbon.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.