Skip to content

Commit 0bbbaab

Browse files
authored
Merge pull request #3 from theBstar/theBstar-patch-1
started hello world
2 parents 4366cae + f173fd6 commit 0bbbaab

File tree

1 file changed

+40
-43
lines changed

1 file changed

+40
-43
lines changed
Lines changed: 40 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -1,88 +1,85 @@
1-
# Hello, world!
1+
# Hello, world! (नमस्ते दुनिया!)
22

33
शिक्षण जो आप पढ़ रहे हैं, वह कोर जावास्क्रिप्ट के बारे में है, जो प्लेटफ़ॉर्म-स्वतंत्र है। इसके अलावा, आप Node.JS और इसका उपयोग करने वाले अन्य प्लेटफ़ॉर्म सीखेंगे।
44

5-
लेकिन, हमें अपनी स्क्रिप्ट को चलाने के लिए काम करने का environment चाहिए, और, सिर्फ इसलिए कि यह पुस्तक ऑनलाइन है, ब्राउज़र एक अच्छा विकल्प है। हम ब्राउज़र-विशिष्ट commands की मात्रा रखेंगे (jase ki `alert`) यदि आप किसी अन्य environment जैसे Node.JS पर ध्यान केंद्रित करने की योजना बनाते हैं, तो न्यूनतम समय मैं उन पर समय व्यतीत न करें। दूसरी ओर, ब्राउज़र विवरण में विस्तार से बताया गया है [अगला भाग](/ui) ट्यूटोरियल का.
5+
लेकिन, हमें अपनी स्क्रिप्ट को चलाने के लिए काम करने का environment चाहिए, और, सिर्फ इसलिए कि यह पुस्तक ऑनलाइन है, ब्राउज़र एक अच्छा विकल्प है। हम ब्राउज़र-विशिष्ट commands की मात्रा कम रखेंगे (जैसे `alert`) ताकि, यदि आप किसी अन्य environment जैसे Node.JS पर ध्यान केंद्रित करने की योजना बनाते हैं, तब आप ब्राउज़र जावास्क्रिप्ट सीखने में समय व्यतीत नहीं करेंगे। हम ट्यूटोरियल के [अगले भाग](/ui) में ब्राउज़र जावास्क्रिप्ट पर ध्यान केंद्रित करेंगे।
66

7+
तो पहले यह देखते हैं कि हम किसी स्क्रिप्ट को वेबपेज से कैसे जोड़ते हैं। सर्वर-साइड वातावरण (जैसे Node.js) के लिए, आप स्क्रिप्ट को `"node my.js"` जैसे कमांड से निष्पादित कर सकते हैं।
78

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+
## "स्क्रिप्ट" टैग
910

11+
जावास्क्रिप्ट प्रोग्रामों को HTML दस्तावेज़ के किसी भी भाग में `<script>` टैग की सहायता से डाला जा सकता है।
1012

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+
उदाहरण के लिए:
1614

1715
```html run height=100
1816
<!DOCTYPE HTML>
1917
<html>
2018

2119
<body>
2220

23-
<p>Before the script...</p>
21+
<p>स्क्रिप्ट से पहले...</p>
2422

2523
*!*
2624
<script>
2725
alert( 'Hello, world!' );
2826
</script>
2927
*/!*
3028

31-
<p>...After the script.</p>
29+
<p>...स्क्रिप्ट के बाद.</p>
3230

3331
</body>
3432

3533
</html>
3634
```
3735

3836
```online
39-
You can run the example by clicking the "Play" button in the right-top corner of the box above.
37+
आप ऊपर दिए गए बॉक्स के दाएं-कोने में "प्ले" बटन पर क्लिक करके उदाहरण चला सकते हैं।
4038
```
4139

42-
The `<script>` tag contains JavaScript code which is automatically executed when the browser processes the tag.
43-
40+
`<स्क्रिप्ट>` टैग में जावास्क्रिप्ट कोड होता है जो ब्राउज़र द्वारा टैग को संसाधित (process) करने पर स्वचालित रूप से निष्पादित होता है।
4441

45-
## Modern markup
42+
## आधुनिक मार्कअप (markup)
4643

47-
The `<script>` tag has a few attributes that are rarely used nowadays but can still be found in old code:
44+
`<स्क्रिप्ट>` टैग में कुछ attributes (विशेषताएं) हैं जो आजकल शायद ही कभी उपयोग की जाती हैं, लेकिन अभी भी पुराने कोड में पाई जा सकती हैं:
4845

49-
The `type` attribute: <code>&lt;script <u>type</u>=...&gt;</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.
46+
`type` attribute: <code>&lt;script <u>type</u>=...&gt;</code>
47+
: पुराने HTML संस्करण, HTML4 में स्क्रिप्ट में एका attribute `type` की आवश्यकता होती है। `type`. आमतौर पर यह `type="text/javascript"` था. इसकी अब आवश्यकता नहीं है। साथ ही, आधुनिक HTML मानक ने इस विशेषता के अर्थ को पूरी तरह से बदल दिया है। अब, इसका उपयोग जावास्क्रिप्ट मॉड्यूल के लिए किया जा सकता है। लेकिन यह एक उन्नत विषय है, हम ट्यूटोरियल के दूसरे भाग में मॉड्यूल के बारे में बात करेंगे।
5148

52-
The `language` attribute: <code>&lt;script <u>language</u>=...&gt;</code>
53-
: 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.
49+
`language` attribute: <code>&lt;script <u>language</u>=...&gt;</code>
50+
: यह attribute स्क्रिप्ट की भाषा दिखाने के लिए थी। यह attribute अब मायने नहीं रखती है क्योंकि जावास्क्रिप्ट डिफ़ॉल्ट भाषा है। इसका उपयोग करने की कोई आवश्यकता नहीं है।
5451

55-
Comments before and after scripts.
56-
: In really ancient books and guides, you may find comments inside `<script>` tags, like this:
52+
स्क्रिप्ट से पहले और बाद की टिप्पणियाँ।
53+
: वास्तव में पुरानी किताबों और गाइडों में, आप इस तरह से `<स्क्रिप्ट> टैग के अंदर टिप्पणी पा सकते हैं:
5754

5855
```html no-beautify
5956
<script type="text/javascript"><!--
6057
...
6158
//--></script>
6259
```
6360

64-
This trick isn't used in modern JavaScript. These comments hide JavaScript code from old browsers that didn't know how to process the `<script>` tag. Since browsers released in the last 15 years don't have this issue, this kind of comment can help you identify really old code.
61+
इस तकनीक का उपयोग आधुनिक जावास्क्रिप्ट में नहीं किया जाता है। ये टिप्पणियां जावास्क्रिप्ट कोड को उन पुराने ब्राउज़रों से छिपाती हैं, जो '<स्क्रिप्ट>' टैग को प्रोसेस करना नहीं जानते थे। चूंकि पिछले 15 वर्षों में जारी किए गए ब्राउज़रों में यह समस्या नहीं है, इसलिए इस तरह की टिप्पणी से आप वास्तव में पुराने कोड को पहचान सकते हैं।
6562

6663

67-
## External scripts
64+
## बाहरी स्क्रिप्ट
6865

69-
If we have a lot of JavaScript code, we can put it into a separate file.
66+
यदि हमारे पास बहुत अधिक जावास्क्रिप्ट कोड है, तो हम इसे एक अलग फाइल में डाल सकते हैं।
7067

71-
Script files are attached to HTML with the `src` attribute:
68+
स्क्रिप्ट फाइलें HTML से `src` विशेषता के साथ जुड़ी हुई हैं:
7269

7370
```html
7471
<script src="/path/to/script.js"></script>
7572
```
7673

77-
Here, `/path/to/script.js` is an absolute path to the script from the site root. One can also provide a relative path from the current page. For instance, `src="script.js"` would mean a file `"script.js"` in the current folder.
74+
यहाँ, `/path/to/script.js` यह साइट रूट से स्क्रिप्ट के लिए एक absolute (निरपेक्ष) पथ है। वर्तमान पृष्ठ से कोई एक relative (आपेक्षिक) पथ भी प्रदान कर सकता है। उदाहरण के लिए, `src="script.js"` वर्तमान फोल्डर के अंदर एक फ़ाइल `"script.js"` का अर्थ होगा।
7875

79-
We can give a full URL as well. For instance:
76+
हम एक पूर्ण URL भी दे सकते हैं। उदाहरण के लिए:
8077

8178
```html
8279
<script src="https://cdnjs.cloudflare.com/ajax/libs/lodash.js/4.17.11/lodash.js"></script>
8380
```
8481

85-
To attach several scripts, use multiple tags:
82+
कई स्क्रिप्ट संलग्न करने के लिए, कई टैग का उपयोग करें:
8683

8784
```html
8885
<script src="/js/script1.js"></script>
@@ -91,29 +88,29 @@ To attach several scripts, use multiple tags:
9188
```
9289

9390
```smart
94-
As a rule, only the simplest scripts are put into HTML. More complex ones reside in separate files.
91+
एक नियम के रूप में, केवल सरलतम स्क्रिप्ट HTML में डाली जाती हैं। अधिक जटिल अलग फ़ाइलों में रहते हैं।
9592
96-
The benefit of a separate file is that the browser will download it and store it in its [cache](https://en.wikipedia.org/wiki/Web_cache).
93+
एक अलग फ़ाइल का लाभ यह है कि ब्राउज़र इसे डाउनलोड करेगा और इसे अपने कैश में रखेगा [cache](https://en.wikipedia.org/wiki/Web_cache).
9794
98-
Other pages that reference the same script will take it from the cache instead of downloading it, so the file is actually downloaded only once.
95+
उसी स्क्रिप्ट को संदर्भित करने वाले अन्य पृष्ठ इसे डाउनलोड करने के बजाय इसे कैश से ले लेंगे, इसलिए फ़ाइल वास्तव में केवल एक बार डाउनलोड की जाती है।
9996
100-
That reduces traffic and makes pages faster.
97+
यह ट्रैफ़िक कम करता है और पृष्ठों को तेज़ बनाता है।
10198
```
10299

103-
````warn header="If `src` is set, the script content is ignored."
104-
A single `<script>` tag can't have both the `src` attribute and code inside.
100+
````warn header="यदि `src` सेट है, तो स्क्रिप्ट के अंदर मौजूद कोड को अनदेखा कर दिया जाता है।"
101+
एक <script> `टैग के अंदर` src` attribute और कोड दोनों नहीं हो सकते।
105102

106-
This won't work:
103+
यह काम नहीं करेगा:
107104

108105
```html
109106
<script *!*src*/!*="file.js">
110-
alert(1); // the content is ignored, because src is set
107+
alert(1); // इस कोड को अनदेखा कर दिया जाएगा, क्योंकि src सेट है
111108
</script>
112109
```
113110

114-
We must choose either an external `<script src="…">` or a regular `<script>` with code.
111+
हमें या तो बाहरी स्क्रिप्ट का चयन करना होगा जैसे `<script src =" ... ">` या हमें नियमित रूप से `<script>` टैग के अंदर कोड लिखना होगा।
115112

116-
The example above can be split into two scripts to work:
113+
ऊपर दिए गए उदाहरण को कार्य करने के लिए दो लिपियों में विभाजित किया जा सकता है:
117114

118115
```html
119116
<script src="file.js"></script>
@@ -123,11 +120,11 @@ The example above can be split into two scripts to work:
123120
```
124121
````
125122
126-
## Summary
123+
## सारांश
127124
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> के साथ डाला जा सकता है।
131128
132129
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

Comments
 (0)