Skip to content

Commit 0ca35bd

Browse files
author
Md. Jamal Uddin
authored
Merge pull request #21 from shuvo575/master
Interaction: alert, prompt, confirm
2 parents c8c8cb4 + 2a5d429 commit 0ca35bd

File tree

2 files changed

+41
-42
lines changed

2 files changed

+41
-42
lines changed

Diff for: 1-js/02-first-steps/09-alert-prompt-confirm/1-simple-page/task.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@ importance: 4
22

33
---
44

5-
# A simple page
5+
# একটি সহজ পৃষ্ঠা
66

7-
Create a web-page that asks for a name and outputs it.
7+
একটি ওয়েব পেজ তৈরী করুন, যেটা একটি নাম জিজ্ঞেস করবে এবং নামটি দেখাবে।
88

99
[demo]
+39-40
Original file line numberDiff line numberDiff line change
@@ -1,109 +1,108 @@
1-
# Interaction: alert, prompt, confirm
1+
# ইন্টারেকশন: alert, prompt, confirm
22

3-
In this part of the tutorial we cover JavaScript language "as is", without environment-specific tweaks.
3+
টিউটোরিয়ালের এই পর্যায়ে আমরা কোনো বিশেষ পরিবেশ সমন্বয় ছাড়া জাভাস্ক্রিপ্ট দেখবো।
44

5-
But we'll still be using the browser as our demo environment, so we should know at least a few of its user-interface functions. In this chapter, we'll get familiar with the browser functions `alert`, `prompt` and `confirm`.
5+
কিন্তু আমরা এখনো ব্রাউজার ব্যবহার করবো আমাদের ডেমো পরিবেশ হিসেবে, এখন আমাদের জানা উচিত এর কিছু ব্যবহারকারী ইন্টারফেস ফাংশন সম্পর্কে। এই চ্যাপ্টারে আমরা পরিচিত হবো ব্রাউজার ফাংশন `alert`, `prompt` এবং `confirm` এর সাথে।
66

77
## alert
88

9-
Syntax:
9+
গঠন:
1010

1111
```js
1212
alert(message);
1313
```
1414

15-
This shows a message and pauses script execution until the user presses "OK".
15+
এটি একটি বার্তা প্রদর্শন করে বাকি স্ক্রিপ্ট আটকে রাখে ব্যবহারকারী OK প্রেস করার আগ পর্যন্ত।
1616

17-
For example:
17+
যেমন:
1818

1919
```js run
20-
alert("Hello");
20+
alert("হ্যালো");
2121
```
2222

23-
The mini-window with the message is called a *modal window*. The word "modal" means that the visitor can't interact with the rest of the page, press other buttons, etc. until they have dealt with the window. In this case -- until they press "OK".
23+
বার্তা সহ ছোট উইন্ডোকে *মডাল উইন্ডো* বলে। মডাল মানে হলো, ব্যবহারকারী যতক্ষণ না এই উইন্ডো এর কাজ না করছেন ততক্ষন বাকি পেজ এর কোনো কাজ করতে পারবেন না, অন্য কোনো বাটন চাপতে পারবেন না ইত্যাদি। এইক্ষেত্রে, --যতক্ষণ না তিনি OK চাপছেন।
2424

2525
## prompt
2626

27-
The function `prompt` accepts two arguments:
27+
এই `prompt` ফাংশন দুটি আর্গুমেন্ট নেয়।
2828

2929
```js no-beautify
3030
result = prompt(title, [default]);
3131
```
3232

33-
It shows a modal window with a text message, an input field for the visitor, and the buttons OK/Cancel.
33+
এটি একটি মডাল উইন্ডো, যা একটি বার্তা, একটি ইনপুট ফিল্ড এবং OK/Cancel বাটন দেখায়।
3434

3535
`title`
36-
: The text to show the visitor.
36+
: যে বার্তা ব্যবহারকারীকে দেখাতে চান।
3737

3838
`default`
39-
: An optional second parameter, the initial value for the input field.
39+
: এটি একটি ঐচ্ছিক প্যারামিটার, এর প্রাথমিক মান ইনপুট ফিল্ড হতে প্রাপ্ত মান।
4040

41-
The visitor may type something in the prompt input field and press OK. Or they can cancel the input by pressing Cancel or hitting the `key:Esc` key.
41+
ব্যবহারকারী চাইলে ইনপুট ফিল্ডে কিছু টাইপ করে OK চাপতে পারে। অথবা চাইলে ইনপুট টি বাতিল করতে পারে Cancel চেপে অথবা `key:Esc` চেপে।
4242

43-
The call to `prompt` returns the text from the input field or `null` if the input was canceled.
43+
`prompt` ফাংশন ইনপুট ফিল্ড এর লেখা রিটার্ন করে অথবা `null` রিটার্ন করে যদি ইনপুট বাতিল করা হয়।
4444

45-
For instance:
45+
যেমন:
4646

4747
```js run
48-
let age = prompt('How old are you?', 100);
48+
let age = prompt('তোমার বয়স কত?', 100);
4949

50-
alert(`You are ${age} years old!`); // You are 100 years old!
50+
alert(`তোমার বয়স ${age} বছর!`); // তোমার বয়স ১০০ বছর!
5151
```
5252

53-
````warn header="In IE: always supply a `default`"
54-
The second parameter is optional, but if we don't supply it, Internet Explorer will insert the text `"undefined"` into the prompt.
53+
````warn header="ইন্টারনেট এক্সপ্লোরার এ সব সময় `default` দিয়ে দিন"
54+
দ্বিতীয় প্যারামিটারটি ঐচ্ছিক কিন্তু যদি আমরা এটি না দেই তাহলে ইন্টারনেট এক্সপ্লোরার লেখাটিকে প্রম্পটের মধ্যে `"undefined"` সেট করে দিবে।
5555

56-
Run this code in Internet Explorer to see:
56+
এই কোডটা ইন্টারনেট এক্সপ্লোরারে রান করে দেখুন:
5757

5858
```js run
59-
let test = prompt("Test");
59+
let test = prompt("পরীক্ষা");
6060
```
6161

62-
So, for prompts to look good in IE, we recommend always providing the second argument:
62+
তাই, প্রমপ্টকে ইন্টারনেট এক্সপ্লোরারে সুন্দর দেখানোর জন্য আমরা সুপারিশ করছি সবসময় দ্বিতীয় আর্গুমেন্টটি দেয়ার জন্য।
6363

6464
```js run
65-
let test = prompt("Test", ''); // <-- for IE
65+
let test = prompt("পরীক্ষা", ''); // <-- ইন্টারনেট এক্সপ্লোরারের জন্য।
6666
```
67-
````
6867

6968
## confirm
7069

71-
The syntax:
70+
গঠন:
7271

7372
```js
7473
result = confirm(question);
7574
```
7675

77-
The function `confirm` shows a modal window with a `question` and two buttons: OK and Cancel.
76+
`confirm` ফাংশন একটি মডাল, একটি দেখায় যেখানে একটি `question` এবং দুইটি OK Cancel বাটন আছে।
7877

79-
The result is `true` if OK is pressed and `false` otherwise.
78+
যদি Ok চাপা হয় তাহলে ফলাফল `true`, অন্যথায় `false` হয়ে থাকে।
8079

81-
For example:
80+
যেমন:
8281

8382
```js run
84-
let isBoss = confirm("Are you the boss?");
83+
let isBoss = confirm("আপনি কি বস?");
8584

86-
alert( isBoss ); // true if OK is pressed
85+
alert( isBoss ); // true যদি Ok চেপে থাকেন।
8786
```
8887

89-
## Summary
88+
## সারমর্ম
9089

91-
We covered 3 browser-specific functions to interact with visitors:
90+
আমরা আজকে ব্যবহারকারীদের সাথে মতবিনিময় করার জন্য ব্রাউজার-নির্দিষ্ট তিনটি ফাংশন সম্পর্কে জানলাম।
9291

9392
`alert`
94-
: shows a message.
93+
: একটি বার্তা দেখায়।
9594

9695
`prompt`
97-
: shows a message asking the user to input text. It returns the text or, if Cancel button or `key:Esc` is clicked, `null`.
96+
: একটি বার্তা দেখায় যাতে ব্যবহারকারী কিছু `input`দিতে পারে। এটি `input` টিকে স্ট্রিং হিসেবে রিটার্ন করে অথবা `Cancel` বা `key:Esc` চাপ দিলে `null` রিটার্ন করে।
9897

9998
`confirm`
100-
: shows a message and waits for the user to press "OK" or "Cancel". It returns `true` for OK and `false` for Cancel/`key:Esc`.
99+
: একটি বার্তা দেখায় এবং ব্যবহারকারীর নির্দেশের অপেক্ষা করে। যদি Ok চাপা হয় তাহলে `true` রিটার্ন করে। আর Cancel/`key:Esc` চাপলে `false` রিটার্ন করে।
101100

102-
All these methods are modal: they pause script execution and don't allow the visitor to interact with the rest of the page until the window has been dismissed.
101+
এই সব পদ্ধতি-ই মডাল। তারা স্ক্রিপ্ট চালানো বন্ধ রাখে এবং ব্যবহারকারীকে অন্যকিছু করতে দেয় না, যতক্ষণ না এই মডাল বাতিল করা না হচ্ছে।
103102

104-
There are two limitations shared by all the methods above:
103+
উপরে উল্লিখিত পদ্ধতি গুলোতে দুইটি সীমাবদ্ধতা আছে:
105104

106-
1. The exact location of the modal window is determined by the browser. Usually, it's in the center.
107-
2. The exact look of the window also depends on the browser. We can't modify it.
105+
১. মডাল উইন্ডো প্রদর্শন এর স্থান নির্দেশিত হয় ব্রাউজার দ্বারা। সাধারণত এটি মাঝখানে হয়।
106+
২. মডাল এর ডিজাইনও ব্রাউজারের উপর নির্ভর করে। আমরা চাইলে এটি বদলাতে পারি না।
108107

109-
That is the price for simplicity. There are other ways to show nicer windows and richer interaction with the visitor, but if "bells and whistles" do not matter much, these methods work just fine.
108+
ব্যবহারকারীর সাথে মতবিনিময় করার এটিই সবচেয়ে সহজ উপায় তাই কিছুতো ছাড় দিতেই হবে। তবে যদি খুব বেশি সমস্যা না থাকে আপনি এগুলো ব্যবহার করতে পারেন। অবশ্য আরো অনেক পদ্ধতি আছে আরো সুন্দর ও সমৃদ্ধ উইন্ডো তৈরী করে ব্যবহারকারীর সাথে মতবিনিময় করার।

0 commit comments

Comments
 (0)