-
Notifications
You must be signed in to change notification settings - Fork 17
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Mi code #12
base: master
Are you sure you want to change the base?
Mi code #12
Conversation
index.html
Outdated
@@ -3,8 +3,10 @@ | |||
<head> | |||
<meta charset="utf-8"> | |||
<title>Mini Weather App</title> | |||
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/normalize/7.0.0/normalize.min.css" integrity="sha256-HxaKz5E/eBbvhGMNwhWRPrAR9i/lG1JeT4mD6hCQ7s4=" crossorigin="anonymous" /> | |||
<link rel="stylesheet" href="css/style.css"> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Make sure your custom CSS is the last file loaded (bootstrap , normalize, googlefont) should all be first.
$(document).ready(function(){ | ||
console.log('ready'); | ||
|
||
//I DONT KNOW WHAT TO DO TO MAKE MY WEBSITE DELETE OLD STUFF ON ENTRY!!! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You can try to just clear out the text in those inputs by setting it to an empty string $(input).text('')
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
that worked; thank you. i tried my .remove()
functions again, and apparently they work now 😄
edit: i lied, something is wrong with them.. i'll try both in the future.
$.ajax({ | ||
method: 'GET', | ||
url: 'http://api.openweathermap.org/data/2.5/weather', | ||
data: $('form').serialize() + '&units=imperial&appid=a77765c844f61df44fe43412c991b9cf', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since you are serializing the form, you can also add two hidden inputs for appid and units to the form to be included instead of writing them out by hand here.
var temp = parseFloat(data.main.temp); | ||
console.log(temp); | ||
$('.temperature-container').css('visibility', 'visible'); | ||
$('.temperature').append(temp + String.fromCharCode(176) + "F"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice find!! This would be a good spot to have a comment to let others know what the code is for.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
for the styling, temperature format when append
'ed to html, or both?
|
||
// error 403 forbidden for img :'( | ||
function displayCityAndIcon(data){ | ||
var cityName = String(data.name); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This works, but it's unnecessary since the data.name returned is already a string.
…y jo; safety commit, progress to be made... over and out
…on changing based on actual weather description), needs work on rwd
Karla Moreno submitting weather-app assignment
...most definitely should've given myself more time to do this assignment