Using a Dictionary API Exercise 5 | JavaScript Tutorial In Hindi #38

preview_player
Показать описание


Best Hindi Videos For Learning Programming:

►C Language Complete Course In Hindi -

►JavaScript Complete Course In Hindi -

►Django Complete Course In Hindi -

Follow Me On Social Media
Рекомендации по теме
Комментарии
Автор

console.log(`Using a Dictionary API Exercise 5 | JavaScript Tutorial In Hindi #38`);
/*
You have pretend to use a word api which will contain an object and you hve to print definition from all the results of that word api.
You have to print it in the dom
If you are using bootstrap then its a plus
*/

// Grab the meanings button
let meanings =
meanings.addEventListener('click', getDefination);

// Impleneting the getDefination function
function getDefination() {
// Instansiate an xhr object
let xhr = new XMLHttpRequest();

// Open the object
xhr.open('GET', 'Exercise_5.json', true);

// What to do on progress
xhr.onprogress = function () {
console.log(`On progress`);
}

// what to do when response is ready
xhr.onload = function () {
if (this.status === 200) {
//
let obj =
for (let index = 0; index < obj.results.length; index++) {
const element =
console.log(element);
populate(element);
}

}
else {
console.log(`Some error occured`)
}
}

// Send the request
xhr.send();
}

function populate(element) {
let html = "";
html += `<li class="py-2 list-group-item list-group-item-light">One of the defination of example is: ${element}</li>`;
// Grab the definations li
let definations = += html;
}
// Thanks sir for all of this stuff

khizrshaikh
Автор

hello bhaiya. i satrted watching your videos and to be honest they are really very helpful and u explain the programmes so well. i met your dad on a train journey from mangalore to bamgalore when he was coming after the admisn of your sister in medical colg and he suggested me to watch your videos.

souravsingh
Автор

Commented before watching Harry Bhai lots of love from Odisha

ashirbadpanigrahi
Автор

Sir, my question is that "Do a large amount of comments cover a much of the storage or they affect the execution or not ???
Sir, Plz Reply...

vickeyraghav
Автор

Sir, how could I use the form feed escape sequence to n C. I used it but no change in the string is shown after I use the ' \f ' escape sequence..

vickeyraghav
Автор

/*You have to pretend to use a word api which will contain an object and you have to print definition from all the result of that word api.
You have to take input from an input tag.
You have to print it in the dom.
if you are using bootstrap then its a plus
*/

let btnSearch =
btnSearch.addEventListener("click", searchFunc);

function searchFunc () {
console.log("You have clicked the search Button.");
let keyword =

//Ajax
let xhr = new XMLHttpRequest();

xhr.open("GET", "harry.txt", true);

xhr.onload = function () {
let responseObj =

let show =
if(keyword.value == responseObj.word){
show.innerText = responseObj.definition;

= "";
}else{
show.innerText = "Word meaning not found."
console.log("Word meaning not found.")
}
}

xhr.send();
}

crazyforcomputers
Автор

bhai ki iss din sailiry mili hai sayad
😂💕💕😂😂😂

businessaccount
Автор

abhi tak to apki voice slow thi achanak anjana om kashyap zaisi voice kaisi ho gayi bhai

mazekaro
Автор

i tried this:
console.log('tut38(ex5)');
const wordApi = [
{
definition: "the divine word of God; the second person in the Trinity (incarnate in Jesus)",
partOfSpeech: "noun"
},
{
definition : "a verbal command for action",
partsOfSpeech : "noun"
}

]
function definition(element) {
setTimeout(function () {
wordApi.push(element);
console.log("elements pushed");
}, 2000);
}
function getDefinition() {
setTimeout(function () {
console.log('getting definitions');
let str = "";
wordApi.forEach(function (define) {
str += `<li>${define.definition} </li>`;
});
= str;
console.log('Here are your definitoions..');
}, 3000);
}
let newd = {definition: "to store", partsOfSpeech : "verb"};
definition(newd);
getDefinition();

preetiharjani
Автор

Harry bhai maine Design bhi Khud kiya hai dekho zara.

tanaymishra
Автор

copy the things into JSON file easy pesy

aryan_
Автор

#khatron_ke _khiladi
//not used bootstrap but given same effect using css
//dictionary contains only these words - code, with, harry, best, tutorial


html file code-
<!doctype html>
<html lang="en">

<head>
<title>Word API</title>
<style>
button{
background-color: blue;
color: white;
font-weight: 700;
box-shadow: 0px 0px 8px red;
margin: 3px;
padding: 10px;
size: 15px;
}
h1{
color :hotpink;
box-shadow: 0px 0px 8px yellow;
}

</style>
</head>
<body>
<h1>Welcome to API Dictionary</h1>

</body>
<script src="tut2.js"></script>
</html>






JAVA SCRIPT FILE CODE-
const word =[{
"word": "code",
"definitions": [
{
"definition": "a set of rules or principles or laws (especially written ones)",
"partOfSpeech": "noun"
},
{
"definition": "(computer science) the symbolic arrangement of data or instructions in a computer program or the set of such instructions",
"partOfSpeech": "noun"
},
{
"definition": "convert ordinary language into code",
"partOfSpeech": "verb"
},
{
"definition": "a coding system used for transmitting messages requiring brevity or secrecy",
"partOfSpeech": "noun"
},
{
"definition": "attach a code to",
"partOfSpeech": "verb"
}
]
}, {
"word": "with",
"definitions": [
{
"definition": "denotes or expresses some situation or relation of nearness, proximity, association, connection, or the like.",
"partOfSpeech": "preposition"
}
]
}, {
"word": "harry",
"definitions": [
{
"definition": "make a pillaging or destructive raid on (a place), as in wartimes",
"partOfSpeech": "verb"
},
{
"definition": "annoy continually or chronically",
"partOfSpeech": "verb"
}
]
}, {
"word": "best",
"definitions": [
{
"definition": "Canadian physiologist (born in the United States) who assisted F. G. Banting in research leading to the discovery of insulin (1899-1978)",
"partOfSpeech": "noun"
},
{
"definition": "(comparative and superlative of `well') wiser or more advantageous and hence advisable",
"partOfSpeech": "adjective"
},
{
"definition": "from a position of superiority or authority",
"partOfSpeech": "adverb"
},
{
"definition": "the person who is most outstanding or excellent; someone who tops all others",
"partOfSpeech": "noun"
},
{
"definition": "get the better of",
"partOfSpeech": "verb"
},
{
"definition": "(superlative of `good') having the most positive qualities",
"partOfSpeech": "adjective"
},
{
"definition": "the supreme effort one can make",
"partOfSpeech": "noun"
}
]
}, {
"word": "tutorial",
"definitions": [
{
"definition": "a session of intensive tuition given by a tutor to an individual or to a small number of students",
"partOfSpeech": "noun"
},
{
"definition": "of or relating to tutors or tutoring",
"partOfSpeech": null
}
]
}]


let inputTag =
inputTag.setAttribute('type', 'text');
inputTag.setAttribute('style', 'border : 3px solid black; padding:3px');

let bodyTag =
bodyTag.innerHTML = `<h1 align="center">Welcome to API Dictionary</h1><br><br>Enter your word to search<br><br>`;

let search =
let results =

search.innerHTML = `<br><button type="button"
bodyTag.appendChild(search);

document.getElementById('search').addEventListener('click', fun);


function fun()
{ // console.log('click listner');
let str = `<h3>Search Results</h3><br>`;
let wordToSearch = inputTag.value;
// console.log(word);
let index;
for(key in index = key;}
// console.log(index);
if(index==undefined)
{
str = `<h3>No Match Found</h3>`;
}
else{
let obj = word[index].definitions;
for(key in obj)
{
str = str +

}
}
results.innerHTML = str;
}

avshek_ps
Автор

Object.results.length ko undefined show krr rha hain

jadvindersingh
Автор

hi sir
apki aik help chahiyah thi please

SuperAbidsaleem
Автор

Are you hate Java and Android development??

groww
welcome to shbcf.ru