Lab 34 Reflection

     Lab 34 was about using JS to calculate the location of the user's device. The HTML for this was pretty simple, setting up a few <h1> and <span> tags to refer back to in my JS to display the location calculations. In my JS, I stored these <h1> and <span>s in their own variable. Using the navigator.geolocation.watchPosition((data) method of JS, I logged where the user was in the console by using console.log(data); and used DOM to reflect the user's location in the HTML by referring to the variables I stored my HTML elements in.
     These skills are important for a web designer because they can enhance a website based on certain aspects of the company and user needs. If a company has physical locations the user can go to and the user wants to visit these locations, the website can incorporate geolocation to retrieve data on where the user is and display the closest stores to the user. This way, the user doesn't have to go through the hassle of searching for the locations themselves, enhancing the user experience.

Comments

Popular Posts