Skip to content
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

weather-app update #14

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Conversation

rcgutierrez
Copy link

No description provided.

<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css">
<link rel="stylesheet" href="css/style.css">

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good catch!

var toF;
var thisMap;

$('.weather-app').css('background-color', 'rgba(255,255,255,.5)');

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd prefer you set this in the CSS and not use js to add custom styles.

//Initialized description
$('.description').append("<strong>Condition Outside:</strong> ");

$('.submission').click(function(event){

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this doing anything?

$('.flag-icon').empty();
$('.city-error').css('display', 'none');

var toF = parseInt(((((weatherData.main.temp)-273.15)*1.8)+32));

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Instead of doing all the math, you could have also used the API which requires another parameter to be sent as data in your ajax call 'units=imperial'. Since you are serializing your form to get the data automatically, you could have added another hidden input for this <input type="hidden" name="units" value="imperial">.

var toF = parseInt(((((weatherData.main.temp)-273.15)*1.8)+32));
console.dir(toF);
$('.results-city').append(weatherData.name + ", " + weatherData.sys.country);
$('.temperature').append(toF + '°');

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You'll want to look up the character code for the degree symbol. While it may work in some browsers, it will also break in a lot more.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants