Skip to content

weather-app update#14

Open
rcgutierrez wants to merge 1 commit intowdi-atx-12:masterfrom
rcgutierrez:master
Open

weather-app update#14
rcgutierrez wants to merge 1 commit intowdi-atx-12:masterfrom
rcgutierrez:master

Conversation

@rcgutierrez
Copy link

No description provided.

<title>Mini Weather App</title>
<link rel="stylesheet" href="css/style.css">
<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