j1417 sends brownie points to @jasierragarcia :sparkles: :thumbsup: :sparkles:
:cookie: 236 | @jasierragarcia |http://www.freecodecamp.com/jasierragarcia
ferrazoli sends brownie points to @liberaltech :sparkles: :thumbsup: :sparkles:
:cookie: 352 | @liberaltech |http://www.freecodecamp.com/liberaltech
$workMinus.on("click", function() {
if (minutesW > 1) {adjustTimers("W", "-");}
});
$workPlus.on("click", function() {
if (minutesW < 60) {adjustTimers("W", "+");}
});
$breakMinus.on("click", function() {
if (minutesB > 1) {adjustTimers("B", "-");}
});
$breakPlus.on("click", function() {
if (minutesB < 60) {adjustTimers("B", "+");}
});
function adjustTimers(session, adjustment) {
switch (session) {
case "W":
if (adjustment === "+") {minutesW++;} else {minutesW--;}
$workSession.text(minutesW);
break;
case "B":
if (adjustment === "+") {minutesB++;} else {minutesB--;}
$breakSession.text(minutesB);
break;
}
}
var myGlobal = 10;
function fun1(oopsGlobal) {
// Assign 5 to oopsGlobal Here
oopsGlobal = 5;
}
fun1(oopsGlobal)
. This is just showing how a variable that you declare without the var
keyword gets created in the global space.
pyleotrevor sends brownie points to @khaduch :sparkles: :thumbsup: :sparkles:
:star2: 1824 | @khaduch |http://www.freecodecamp.com/khaduch
oopsGlobal
is a hint to what is going on. If you declare a variable, or rather, use it without having declared it, it gets created in the global scope. That is sometimes what you want to do, but it is better to declare it in a global space, as the var myGlobal
is declared, so that you expressly have it created where you want it to be. Global variables are not really good to use, but sometimes that most expedient way to implement something. Just better to not "oops" it, but be explicitly declaring it in a place where it has global scope for the functions that use it.
oopsGlobal
in that instance could have lead to scope issues down the road.
sayrah901 sends brownie points to @jdtdesigns :sparkles: :thumbsup: :sparkles:
:cookie: 715 | @jdtdesigns |http://www.freecodecamp.com/jdtdesigns
display: flex;
justify-content: center;
on your #timer css
annunirmal sends brownie points to @jdtdesigns :sparkles: :thumbsup: :sparkles:
:cookie: 716 | @jdtdesigns |http://www.freecodecamp.com/jdtdesigns
annunirmal sends brownie points to @sorinr :sparkles: :thumbsup: :sparkles:
:cookie: 787 | @sorinr |http://www.freecodecamp.com/sorinr
function pairElement(str) {
var strArray = str.split('');
var dnaArray = [[],[]];
var dnaPair = {};
dnaPair.A = 'T';
dnaPair.G = 'C';
dnaPair.T = 'A';
dnaPair.C = 'G';
for(var i in strArray){
// console.log(str[i]);
if(dnaPair.hasOwnProperty(strArray[i])){
console.log(strArray[i] + " " + dnaPair[str[i]]);
dnaArray.push([strArray[i]][dnaPair[strArray[i]]]);
}
// console.log(dnaArray);
}
// return str;
}
pairElement("ATCGA");
next
tab for further projects more than 7
kinghippo sends brownie points to @jdtdesigns :sparkles: :thumbsup: :sparkles:
:cookie: 717 | @jdtdesigns |http://www.freecodecamp.com/jdtdesigns
kinghippo sends brownie points to @jdtdesigns :sparkles: :thumbsup: :sparkles:
:warning: kinghippo already gave jdtdesigns points
kinghippo sends brownie points to @jdtdesigns :sparkles: :thumbsup: :sparkles:
:warning: kinghippo already gave jdtdesigns points
gare24 sends brownie points to @khaduch :sparkles: :thumbsup: :sparkles:
:star2: 1826 | @khaduch |http://www.freecodecamp.com/khaduch
input
. i want to plain my input
backgrounddesignercoder123 sends brownie points to @gofighting123 :sparkles: :thumbsup: :sparkles:
:cookie: 309 | @gofighting123 |http://www.freecodecamp.com/gofighting123
//$("input[type= range]").change(changeColor);
$("#showColor").css("background-color", "rgb("+ one +","+ two +", " + three + ")");
:clap:
:cookie: 310 | @gofighting123 |http://www.freecodecamp.com/gofighting123
apasternack sends brownie points to @gofighting123 :sparkles: :thumbsup: :sparkles:
<input type="number"
raga22 sends brownie points to @konsal and @gbsimon87 :sparkles: :thumbsup: :sparkles:
:cookie: 358 | @gbsimon87 |http://www.freecodecamp.com/gbsimon87
:cookie: 381 | @konsal |http://www.freecodecamp.com/konsal
mb432 sends brownie points to @jluboff :sparkles: :thumbsup: :sparkles:
:cookie: 411 | @jluboff |http://www.freecodecamp.com/jluboff
{
coord: {
lon: 9.75,
lat: 59
},
weather: [
{
id: 500,
main: "Rain",
description: "light rain",
icon: "10d"
}
],
base: "stations",
main: {
temp: 280.928,
pressure: 1034.19,
humidity: 100,
temp_min: 280.928,
temp_max: 280.928,
sea_level: 1038.56,
grnd_level: 1034.19
},
wind: {
speed: 8.82,
deg: 47.0007
},
I am trying to access main inside weather which inside an object called data. Can any of you see anything I have done wrong?
jQuery.getJSON(url + lat + "&lon=" + lon + "&APPID=" + appID, function(data){
$("#locationP").html(data.name);
$("#temp").html(Math.round(data.main[0].temp) - 273 + "C");
$("#weather").html(data.weather[0].main);
$("#wind").html(data.wind.speed + " M/S")
});
mhdavis sends brownie points to @jdtdesigns and @jluboff :sparkles: :thumbsup: :sparkles:
:cookie: 412 | @jluboff |http://www.freecodecamp.com/jluboff
:cookie: 718 | @jdtdesigns |http://www.freecodecamp.com/jdtdesigns
data.weather[0].main
. That should be correct or did I miss understand you ?
karocann sends brownie points to @jdtdesigns :sparkles: :thumbsup: :sparkles:
:cookie: 719 | @jdtdesigns |http://www.freecodecamp.com/jdtdesigns
skretch sends brownie points to @jdtdesigns :sparkles: :thumbsup: :sparkles:
:cookie: 720 | @jdtdesigns |http://www.freecodecamp.com/jdtdesigns
.fa-twitter {
color: white;
}
.fa-twitter:hover {
color: black;
}
tweetBtn.addEventListener("click", function(){
var myURL = "https://twitter.com/intent/tweet?hashtags=quotes&text=" + quote_content.innerText;
window.open(myURL);
});
tcao2 sends brownie points to @jdtdesigns :sparkles: :thumbsup: :sparkles:
:cookie: 721 | @jdtdesigns |http://www.freecodecamp.com/jdtdesigns
.well{
margin:0px;
width:5px;
padding:100px;
}
width:100%;
j1417 sends brownie points to @magnus195 :sparkles: :thumbsup: :sparkles:
:cookie: 122 | @magnus195 |http://www.freecodecamp.com/magnus195
.well
in your css and do this: <div class="row well">
<div class="col-xs-9">
<p>Informatics Engineering student at National University of la Matanza, Argentina.</p>
</div>
<div class="col-xs-3">
<img src="https://x1.xingassets.com/assets/frontend_minified/img/users/nobody_m.original.jpg" class="img-responsive img-circle">
</div>
</div>
https://wind-bow.hyperdev.space/twitch-api/channel/follows
is wrong try to replace "channel" with the actual channel like https://wind-bow.hyperdev.space/twitch-api/freecodecamp/follows
j1417 sends brownie points to @sorinr and @magnus195 :sparkles: :thumbsup: :sparkles:
:warning: j1417 already gave magnus195 points
:cookie: 788 | @sorinr |http://www.freecodecamp.com/sorinr
https://wind-bow.hyperdev.space/twitch-api/channels/freecodecamp/follows
Hi guys please I need help with the random quote generator project. My code is here: http://codepen.io/freddiefo/pen/xEBwVP
I need to get dynamically loaded html (where the random quotes are meant to appear) and assign to a variable so I can link it to the twitter “data-text” share button. I want to be able to press the tweet button and tweet whatever quote has been generated!
.btn {position:fixed; right:5px; bottom:5px;}
j1417 sends brownie points to @nitinnair89 :sparkles: :thumbsup: :sparkles:
:cookie: 303 | @nitinnair89 |http://www.freecodecamp.com/nitinnair89
img {
margin-top: 150px;
}
nitinnair89 sends brownie points to @fattone225 :sparkles: :thumbsup: :sparkles:
:cookie: 364 | @fattone225 |http://www.freecodecamp.com/fattone225
body {
padding-top: 70px;
}
atharvajava sends brownie points to @nitinnair89 and @konsal :sparkles: :thumbsup: :sparkles:
:cookie: 304 | @nitinnair89 |http://www.freecodecamp.com/nitinnair89
:cookie: 385 | @konsal |http://www.freecodecamp.com/konsal
konsal sends brownie points to @nitinnair89 :sparkles: :thumbsup: :sparkles:
:cookie: 305 | @nitinnair89 |http://www.freecodecamp.com/nitinnair89
https://api.wunderground.com/api/Your_Key/geolookup/q/autoip.json
.playField
classes, and those are not removed. You can probably restructure your code to make sure that you only do that function one time, either with a flag variable to indicate that the click handler is already set, or set the click handler outside of a function that you repeatedly call. I haven't tried to edit the code to see if I can prove that, but I think by analysis that is what is going on.
silver537 sends brownie points to @jdtdesigns :sparkles: :thumbsup: :sparkles:
:cookie: 722 | @jdtdesigns |http://www.freecodecamp.com/jdtdesigns
konsal sends brownie points to @khaduch :sparkles: :thumbsup: :sparkles:
:star2: 1827 | @khaduch |http://www.freecodecamp.com/khaduch
@KonSal - my quick fix was to do this - slight modification to this part of your code:
var clickOn = false;
// Function that takes player input
var getPlayerSequence = function() {
// Play sequence up to the score point.
playSequence();
if (clickOn === false) {
$('.playField').click(function() {
// Animate user-pressed playing fields.
playFieldId = $(this).attr('id');
animateField(playFieldId);
// If the last one is correct, proceed to next round.
// Intoduces 1.5 second delay between rounds.
if (playFieldId == thisRound[0] && thisRound.length === 1) {
setTimeout(function() {
thisRound.shift();
score += 1;
playFieldId = " ";
playSequence();
}, 1500);
// Keep pushing till the last one.
} else if (playFieldId == thisRound[0] && thisRound.length > 1) {
thisRound.shift();
playFieldId = " ";
}
});
};
clickOn = true;
}
Just tracking if the click handler was added, and only allowing it to be added once.
konsal sends brownie points to @khaduch :sparkles: :thumbsup: :sparkles:
:warning: konsal already gave khaduch points
konsal sends brownie points to @khaduch :sparkles: :thumbsup: :sparkles:
:warning: konsal already gave khaduch points
fattone225 sends brownie points to @nitinnair89 :sparkles: :thumbsup: :sparkles:
:cookie: 306 | @nitinnair89 |http://www.freecodecamp.com/nitinnair89
https://api.wunderground.com/api/Your_Key/conditions/q/autoip.json
if anyone get's this chrome console error when using apis or using getjson jquery command: http://i.share.pho.to/17875d4a_o.jpeg
then use this resource: http://crossorigin.me/
It allows you to use resources from other domains without getting this error. The site explains better. Take a look: http://crossorigin.me/
.then
?
data.forecast.map((obj)=> {})
is this rewriting the json data?