5-Days Weather Application using Simple JavaScript | Weather Application

Sdílet
Vložit
  • čas přidán 7. 09. 2024
  • In this tutorial, you will learn how to create a 5-days Weather Application using Simple JavaScript. Build a Weather App with HTML, CSS & JavaScript
    Download the code:
    github.com/Ran...
    Build COVID-19 Application: • Build a COVID-19 Track...
    Build weather Application: • 5-Days Weather Applica...
    Animated Text: • CSS Text Typing Animat...
    JS console Methods: • Top useful JavaScript ...
    Javascript Real-time- Projects: • JavaScript Real-Time P...
    HTML CSS projects : • HTML and CSS Projects
    JavaScript full: • JavaScript Tutorial fo...
    Java Tutorial: • Core Java
    C++ Tutorial : • C++ Tutorials
    JavaScript Array Methods: • Complete Array Methods...
    You will learn #WeatherApplication.
    #5daysweatherapplication
    #javascript

Komentáře • 52

  • @haykalahmed4852
    @haykalahmed4852 Před 2 lety

    bro i wanna say thank you i learnt something from you that took my professor months to explain

  • @Xit0mz
    @Xit0mz Před 2 lety +14

    Has several issues, for example the method you used ain't accounting for the api giving us the temperature each day every 3 hours, so you are displaying the max and min temperature every 3 hours from 00:00 of the starting day, instead of the min and max temperature of each day.

    • @techexpert81
      @techexpert81 Před rokem

      async function getWeather(city) {
      const response2 = await fetch(url2 + city + `&appid=${apiKey2}`)
      const data2 = await response2.json()
      console.log(data2)
      let lists = data2.list

      for (let i = 0; i < lists.length; i+=8) {
      let a=lists[i].main.temp_min

      document.getElementById("min"+(i+8)).innerHTML=a

      }

      }
      function place5d() {
      getWeather(input5d.value)
      }
      btn5d.addEventListener("click", place5d)
      IT WILL PRINT 5 DAY MIN TEMP , ACCORDINGLY YOU CAN ALSO ACCESS MAX TEMP AND ICONS
      IF ANY KIND OF CONFUSION/QUERY
      TELEGRAM:-@M_Uzairshah
      also in the (document.getElementById("min"+(i+8)).innerHTML=a) I HAVE GIVE THE MIN ELEMENTS THE ID OF MIN8,MIN16,MIN24,MIN32 ,MIN40 SO THAT IT WILL MEET THE FOR LOOP REQUIREMENTS AND ALSO IT WILL HELP TO ACCESS THE 5 DAY MIN TEMP
      HERE IS THE HTML CODE:-



      SEARCH




      sunday
      IMG

      MIN:
      MAX:



      monday
      IMG

      MIN:
      MAX:



      tuesday
      IMG

      MIN:
      MAX:



      wednesday
      IMG

      MIN:
      MAX:



      thursday
      IMG

      MIN:
      MAX:

    • @imamanonly
      @imamanonly Před 8 měsíci

      same issue

  • @zacharytaylor2656
    @zacharytaylor2656 Před rokem

    You saved me! Thank you sir for your help!

  • @skarpionkiller3571
    @skarpionkiller3571 Před 2 lety

    Nice

  • @kome.3xe718
    @kome.3xe718 Před 3 lety +3

    Nice Video, But can you include the codes as well in your description.

  • @vincenttunas4510
    @vincenttunas4510 Před rokem

    the days arent accurate, its a forecast for every 3 hours, while 5 days forecast is whats needed.please correct my if im wrong

  • @sasabajic4948
    @sasabajic4948 Před rokem

    So the biggest problem I sed here is uncorrect min. temperature, sometimes minimum temperature is the same or higher than maximum. Why, what do you think?

    • @RanjanBeginnersGuide
      @RanjanBeginnersGuide  Před rokem

      I will have a look

    • @sasabajic4948
      @sasabajic4948 Před rokem

      @@RanjanBeginnersGuide However you did a good job still, maximum temperatures are pretty accurate, I added two more days, so there are 7 days now, I will give you a star on git.

  • @NitinKumar-cy9yq
    @NitinKumar-cy9yq Před 8 měsíci

    How we can store this data into database

  • @vinaykandakatla7168
    @vinaykandakatla7168 Před rokem

    Using forEach is better or map which better instead of for loop

  • @djroby19
    @djroby19 Před rokem

    Hi, could you implement a cache to avoid api calls to openweathermap?

  • @maryamhamayoon6367
    @maryamhamayoon6367 Před rokem

    how can we do if we want to click the city from map and then open the forecast for 5 day not by search the city please help me

    • @RanjanBeginnersGuide
      @RanjanBeginnersGuide  Před rokem +1

      You have to add Google map API

    • @maryamhamayoon6367
      @maryamhamayoon6367 Před rokem

      @@RanjanBeginnersGuide I add svg map but how to call from svg map this weather forecast for example I want to select a city from the map that I have built it after clicking I want you to open 5 day weather forecast

    • @maryamhamayoon6367
      @maryamhamayoon6367 Před rokem

      @@RanjanBeginnersGuide if you have time I can show you on zoom by sharing screen

  • @vaishnavibhosale2272
    @vaishnavibhosale2272 Před rokem

    Anyone have a report on weather forecasting

  • @harikrishna3099
    @harikrishna3099 Před 5 měsíci

    Is it now working?

  • @dhanushgowda9064
    @dhanushgowda9064 Před rokem

    the tille u gave is "Weather Forcast" and in the end of video ur running some another file ,such that title is showing as "Document" titled file. Bro there are lot of bugs in the code.Kindly share the code link in the decription.

    • @RanjanBeginnersGuide
      @RanjanBeginnersGuide  Před rokem +1

      Ok I will

    • @dhanushgowda9064
      @dhanushgowda9064 Před rokem +1

      @@RanjanBeginnersGuide bruh I appreciate u for the whole content,but kindly make sure u post ur guthub link or code in the description, because I have spent more than 5 hours to debug the code

  • @apurvabajpai47
    @apurvabajpai47 Před 2 lety

    how to get same results for latitude and longitude ...?

  • @rohantrivedi2153
    @rohantrivedi2153 Před 2 lety

    i want to take latitude and longitude as input for the same code as yours can you help

    • @RanjanBeginnersGuide
      @RanjanBeginnersGuide  Před 2 lety

      Did you follow my code

    • @rohantrivedi2153
      @rohantrivedi2153 Před 2 lety

      @@RanjanBeginnersGuide Yes . I tried to take latitude and longitude so I changed the new name variable to new latitude and added a new longitude variable and changes the api call to the latitude and longitude call which I got from open weather .

    • @rohantrivedi2153
      @rohantrivedi2153 Před 2 lety

      Could you have a look at the changes ?

  • @tahzib1451
    @tahzib1451 Před 2 lety +2

    tokoyo returned a result....we r doomed....

    • @RanjanBeginnersGuide
      @RanjanBeginnersGuide  Před 2 lety

      Lol

    • @tahzib1451
      @tahzib1451 Před 2 lety

      @@RanjanBeginnersGuide u think this is funny to misspell a city name and still get results?

    • @exoticcarbone
      @exoticcarbone Před rokem

      @@tahzib1451 That's because there is a city called Tokoyo.

  • @addibloger
    @addibloger Před 3 lety +1

    Plz include code in description

    • @RanjanBeginnersGuide
      @RanjanBeginnersGuide  Před 3 lety +1

      Definitely I'm going to do that

    • @addibloger
      @addibloger Před 3 lety

      @@RanjanBeginnersGuide will wait thanks

    • @RanjanBeginnersGuide
      @RanjanBeginnersGuide  Před 3 lety +1

      Sure

    • @addibloger
      @addibloger Před 3 lety

      @@RanjanBeginnersGuide I have tried this with Php but I am failed to get day lowest highest temperatures as it's show 40 records in json
      I think it's hardest part to loop and get daily lowest and highest temperatures
      Thanks

    • @RanjanBeginnersGuide
      @RanjanBeginnersGuide  Před 3 lety

      Check the description for the source code

  • @imkazibille1181
    @imkazibille1181 Před 2 lety +1

    How to I get a 7 day forecast instead of an 5 day forecast?