You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: 1-js/02-first-steps/01-hello-world/article.md
+20-23Lines changed: 20 additions & 23 deletions
Original file line number
Diff line number
Diff line change
@@ -2,52 +2,49 @@
2
2
3
3
शिक्षण जो आप पढ़ रहे हैं, वह कोर जावास्क्रिप्ट के बारे में है, जो प्लेटफ़ॉर्म-स्वतंत्र है। इसके अलावा, आप Node.JS और इसका उपयोग करने वाले अन्य प्लेटफ़ॉर्म सीखेंगे।
4
4
5
-
लेकिन, हमें अपनी स्क्रिप्ट को चलाने के लिए काम करने का environment चाहिए, और, सिर्फ इसलिए कि यह पुस्तक ऑनलाइन है, ब्राउज़र एक अच्छा विकल्प है। हम ब्राउज़र-विशिष्ट commands की मात्रा रखेंगे (jase ki `alert`) यदि आप किसी अन्य environment जैसे Node.JS पर ध्यान केंद्रित करने की योजना बनाते हैं, तो न्यूनतम समय मैं उन पर समय व्यतीत न करें। दूसरी ओर, ब्राउज़र विवरण में विस्तार से बताया गया है [अगला भाग](/ui)ट्यूटोरियल का. (update required)
5
+
लेकिन, हमें अपनी स्क्रिप्ट को चलाने के लिए काम करने का environment चाहिए, और, सिर्फ इसलिए कि यह पुस्तक ऑनलाइन है, ब्राउज़र एक अच्छा विकल्प है। हम ब्राउज़र-विशिष्ट commands की मात्रा कम रखेंगे (जैसे `alert`) ताकि, यदि आप किसी अन्य environment जैसे Node.JS पर ध्यान केंद्रित करने की योजना बनाते हैं, तब आप ब्राउज़र जावास्क्रिप्ट सीखने में समय व्यतीत नहीं करेंगे। हम ट्यूटोरियल के [अगले भाग](/ui) में ब्राउज़र जावास्क्रिप्ट पर ध्यान केंद्रित करेंगे।
6
6
7
+
तो पहले यह देखते हैं कि हम किसी स्क्रिप्ट को वेबपेज से कैसे जोड़ते हैं। सर्वर-साइड वातावरण (जैसे Node.js) के लिए, आप स्क्रिप्ट को `"node my.js"` जैसे कमांड से निष्पादित कर सकते हैं।
7
8
8
-
So first, let's see how we attach a script to a webpage. For server-side environments (like Node.js), you can execute the script with a command like `"node my.js"`.
9
+
## "स्क्रिप्ट" टैग
9
10
11
+
जावास्क्रिप्ट प्रोग्रामों को HTML दस्तावेज़ के किसी भी भाग में `<script>` टैग की सहायता से डाला जा सकता है।
10
12
11
-
## The "script" tag
12
-
13
-
JavaScript programs can be inserted into any part of an HTML document with the help of the `<script>` tag.
14
-
15
-
For instance:
13
+
उदाहरण के लिए:
16
14
17
15
```html run height=100
18
16
<!DOCTYPE HTML>
19
17
<html>
20
18
21
19
<body>
22
20
23
-
<p>Before the script...</p>
21
+
<p>स्क्रिप्ट से पहले...</p>
24
22
25
23
*!*
26
24
<script>
27
25
alert( 'Hello, world!' );
28
26
</script>
29
27
*/!*
30
28
31
-
<p>...After the script.</p>
29
+
<p>...स्क्रिप्ट के बाद.</p>
32
30
33
31
</body>
34
32
35
33
</html>
36
34
```
37
35
38
36
```online
39
-
You can run the example by clicking the "Play" button in the right-top corner of the box above.
37
+
आप ऊपर दिए गए बॉक्स के दाएं-कोने में "प्ले" बटन पर क्लिक करके उदाहरण चला सकते हैं।
40
38
```
41
39
42
-
The `<script>` tag contains JavaScript code which is automatically executed when the browser processes the tag.
43
-
40
+
`<स्क्रिप्ट>` टैग में जावास्क्रिप्ट कोड होता है जो ब्राउज़र द्वारा टैग को संसाधित (process) करने पर स्वचालित रूप से निष्पादित होता है।
44
41
45
-
## Modern markup
42
+
## आधुनिक मार्कअप (markup)
46
43
47
-
The `<script>`tag has a few attributes that are rarely used nowadays but can still be found in old code:
44
+
`<स्क्रिप्ट>`टैग में कुछ attributes (विशेषताएं) हैं जो आजकल शायद ही कभी उपयोग की जाती हैं, लेकिन अभी भी पुराने कोड में पाई जा सकती हैं:
48
45
49
-
The `type` attribute: <code><script <u>type</u>=...></code>
50
-
: The old HTML standard, HTML4, required a script to have a `type`. Usually it was`type="text/javascript"`. It's not required anymore. Also, the modern HTML standard totally changed the meaning of this attribute. Now, it can be used for JavaScript modules. But that's an advanced topic, we'll talk about modules in another part of the tutorial.
: पुराने HTML संस्करण, HTML4 में स्क्रिप्ट में एका attribute `type` की आवश्यकता होती है। `type`. आमतौर पर यह`type="text/javascript"` था. इसकी अब आवश्यकता नहीं है। साथ ही, आधुनिक HTML मानक ने इस विशेषता के अर्थ को पूरी तरह से बदल दिया है। अब, इसका उपयोग जावास्क्रिप्ट मॉड्यूल के लिए किया जा सकता है। लेकिन यह एक उन्नत विषय है, हम ट्यूटोरियल के दूसरे भाग में मॉड्यूल के बारे में बात करेंगे।
51
48
52
49
The `language` attribute: <code><script <u>language</u>=...></code>
53
50
: This attribute was meant to show the language of the script. This attribute no longer makes sense because JavaScript is the default language. There is no need to use it.
@@ -111,9 +108,9 @@ This won't work:
111
108
</script>
112
109
```
113
110
114
-
We must choose either an external `<script src="…">`or a regular `<script>`with code.
111
+
हमें या तो बाहरी स्क्रिप्ट का चयन करना होगा जैसे `<script src =" ... ">`या हमें नियमित रूप से `<script>`टैग के अंदर कोड लिखना होगा।
115
112
116
-
The example above can be split into two scripts to work:
113
+
ऊपर दिए गए उदाहरण को कार्य करने के लिए दो लिपियों में विभाजित किया जा सकता है:
117
114
118
115
```html
119
116
<scriptsrc="file.js"></script>
@@ -123,11 +120,11 @@ The example above can be split into two scripts to work:
123
120
```
124
121
````
125
122
126
-
## Summary
123
+
## सारांश
127
124
128
-
- We can use a `<script>` tag to add JavaScript code to a page.
129
-
- The `type` and `language` attributes are not required.
130
-
- A script in an external file can be inserted with `<script src="path/to/script.js"></script>`.
125
+
- हम एक पृष्ठ पर जावास्क्रिप्ट कोड जोड़ने के लिए एक `<स्क्रिप्ट>` टैग का उपयोग कर सकते हैं।
126
+
- `टाइप` और` भाषा` attribute की आवश्यकता नहीं है।
127
+
- एक बाहरी फाइल में लिखी गई स्क्रिप्ट को `<script src="path/to/script.js"></script> के साथ डाला जा सकता है।
131
128
132
129
133
-
There is much more to learn about browser scripts and their interaction with the webpage. But let's keep in mind that this part of the tutorial is devoted to the JavaScript language, so we shouldn't distract ourselves with browser-specific implementations of it. We'll be using the browser as a way to run JavaScript, which is very convenient for online reading, but only one of many.
130
+
ब्राउज़र स्क्रिप्ट और वेबपेज के interaction (परस्पर क्रिया) के बारे में जानने के लिए बहुत कुछ है। लेकिन ध्यान रखें कि ट्यूटोरियल का यह हिस्सा जावास्क्रिप्ट भाषा के लिए समर्पित है, इसलिए हमें इसके विशिष्ट ब्राउज़र कार्यान्वयन के साथ खुद को विचलित नहीं करना चाहिए। हम जावास्क्रिप्ट को चलाने के लिए ब्राउज़र का उपयोग करेंगे, जो कई विकल्पों में से ऑनलाइन पढ़ने के लिए बहुत सुविधाजनक है।
0 commit comments