thurstiantsui sends brownie points to @sethmchris and @nathanmcsparran :sparkles: :thumbsup: :sparkles:
:cookie: 244 | @sethmchris |http://www.freecodecamp.com/sethmchris
:cookie: 265 | @nathanmcsparran |http://www.freecodecamp.com/nathanmcsparran
Is there a way to get the top left color yellow when it gets full screen?
eshaffer321 sends brownie points to @mot01 :sparkles: :thumbsup: :sparkles:
:cookie: 507 | @mot01 |http://www.freecodecamp.com/mot01
https://api.twitch.tv/kraken/streams/' + user + '?callback=?',
. In that success function, you make a getJSON call to the same URL which then makes a $.ajax call to the twitch user's channel (which returns no JSON). I don't see how that ever worked?
eweiss17 sends brownie points to @mot01 :sparkles: :thumbsup: :sparkles:
:cookie: 508 | @mot01 |http://www.freecodecamp.com/mot01
deepak8717 sends brownie points to @jtan3 :sparkles: :thumbsup: :sparkles:
:cookie: 302 | @jtan3 |http://www.freecodecamp.com/jtan3
deepak8717 sends brownie points to @jtan3 :sparkles: :thumbsup: :sparkles:
:warning: deepak8717 already gave jtan3 points
muneermk sends brownie points to @jtan3 :sparkles: :thumbsup: :sparkles:
:cookie: 303 | @jtan3 |http://www.freecodecamp.com/jtan3
.value
method, like thisvar input = document.querySelector('selector').value;
$('#input').keypress(function (e){
if ( e.which == 13 ) {
e.preventDefault();
}
var query = $('#input').val();
$('#random').html(query)
})
radekjohn sends brownie points to @johnnybizzel :sparkles: :thumbsup: :sparkles:
:star2: 1274 | @johnnybizzel |http://www.freecodecamp.com/johnnybizzel
.navbar {
margin-bottom: 0;
}
Inside of @keyframes animation - can you select different elements, modify their elements or you can only select one (for example h1, and that's it)?
Some kind of noob example:
@keyframes animation {
h1 {
<!-- some kind of animation here -->
}
h2 {
<!-- some kind of animation here, as well -->
}
}
viorelfoamete sends brownie points to @sorinr :sparkles: :thumbsup: :sparkles:
:star2: 1172 | @sorinr |http://www.freecodecamp.com/sorinr
janepohorecka sends brownie points to @kirbyedy :sparkles: :thumbsup: :sparkles:
:star2: 1773 | @kirbyedy |http://www.freecodecamp.com/kirbyedy
So I am working on the Twitch App. When I call a channel which is offline I get the error message: "Cannote read property of channel of "null"."
This is an example API call. https://wind-bow.gomix.me/twitch-api/streams/freecodecamp?callback=?
And here is my code:
// if channel is offline
if (jsonData.stream === "null"){
}
And a link to the full project: http://codepen.io/philipp32/full/QdrgYR/
import React from 'react';
import ReactDOM from 'react-dom';
import userInput from './components/user_input';
const App = () => {
return (
<div>
<userInput />
</div>
);
}
ReactDOM.render(
<App />,
document.querySelector('#root')
);
./components/user_input.jsx
import React from 'react';
const userInput = () => {
console.log("test");
return <input />;
};
export default userInput;
React.createClass
to create a react component
something like
in your app component
import React from 'react';
import ReactDOM from 'react-dom';
import userInput from './components/user_input';
const App = React.createClass({
render : function(){
return(
<div>
<userInput/>
</div>
);
}
});
ReactDOM.render(
<App />,
document.querySelector('#root')
);
export default App;
user_input
component
function sayHello2(name){
var text='Hello'+name;
var say=function(){
console.log(text);
};
return say;
}
sayHello2("David");
Why when I executed these codes, the display window shows function(){console.log(text}
?
class
syntax
var input = "test";
function myFunction() {
input = document.getElementById("searchbox").value;
}
$("#test").html(input);
I'm doing the wikipedia viewer project. I cant figure out why this function does not change the value of the global variable. The #test object always outputs "test".
$('#searchbox').val();
, It only works with the value i assign beforehand and does not change while i type
outline
instead of border
in the CSSbox-sizing:border-box
to the div (via CSS), then the border is not added to the elements width<form>
<input type="text" id="searchbox" placeholder="Search for...">
</form>
$(document).ready(function() {
$("form").submit(function(e) {
e.preventDefault(); ///<< prevent the page refresh
var input = $('#searchbox').val();
//$("#test").html(input);
//input = input.replace(/[^\w\s]/gi, '');
var url = 'https://en.wikipedia.org/w/api.php?action=opensearch&search=' + input + '&format=json&callback=?';
$.getJSON(url, function(val) {
$('#container').html('');
//var arr = JSON.stringify(val);
for (i = 0; i < val[1].length; i++) {
$("#container").append("<a target=\"_blank\" class=\"well result\" href=\"" + val[3][i] + "\"><h3>" + val[1][i] + "</h3><h5>" + val[2][i] + "</h5>" + "</a>");
}
return $('#searchbox').val('');
});
});
});
@Toffanelly this is how your code should look like for wotking properly
rexbrooker sends brownie points to @taltmann42 :sparkles: :thumbsup: :sparkles:
:cookie: 481 | @taltmann42 |http://www.freecodecamp.com/taltmann42
viorelfoamete sends brownie points to @meli94 :sparkles: :thumbsup: :sparkles:
:cookie: 291 | @meli94 |http://www.freecodecamp.com/meli94
var fruits=['cherry', 'apples','bananas'];
What is the difference between just doing fruits.sort();
and console.log(fruits.sort())
?
@fortMaximus OK....after a bit of a delay I coded from scratch this tribute to Maximilian Kolbe, a Franciscan Friar who swapped places with a condemed man in Auschwitz. I saw a random note on this when searching for something else the other day....and it hit a nerve. http://codepen.io/IanMacMillan/full/mRzqmb/
Yes, the structure of the code is similar to Quincy's, but I've learnt so much from it. The Jumbotron, how to lay out columns and change the offset with different screen widths....
On to the next challenge!
ianmacmillan sends brownie points to @nathanmcsparran :sparkles: :thumbsup: :sparkles:
:cookie: 266 | @nathanmcsparran |http://www.freecodecamp.com/nathanmcsparran
:cookie: 395 | @luiko |http://www.freecodecamp.com/luiko
yanivstern sends brownie points to @luiko :sparkles: :thumbsup: :sparkles:
ianmacmillan sends brownie points to @viorelfoamete :sparkles: :thumbsup: :sparkles:
:cookie: 131 | @viorelfoamete |http://www.freecodecamp.com/viorelfoamete
@AmitP88 okay the title of the dish is below the menu. the price isn't shown because it's not inside the modal. You have this structure:
- modal
- menu-info
but it should be
- modal
-- menu-info
header
element with the id banner
jay397 sends brownie points to @taltmann42 :sparkles: :thumbsup: :sparkles:
:cookie: 483 | @taltmann42 |http://www.freecodecamp.com/taltmann42
amitp88 sends brownie points to @taltmann42 :sparkles: :thumbsup: :sparkles:
:cookie: 484 | @taltmann42 |http://www.freecodecamp.com/taltmann42
function getIndexToIns(arr, num) {
arr=arr.sort(function(a,b){
return a-b;
});
var result=arr.filter(function(el){
return el>=num;
});
if (result===[]){
return ar.length;
}else return arr.indexOf(result[0]);
}
getIndexToIns([2,5,10], 15);
Why doesn't it return 3? Something wrong with my if statement?
arr.length
btw, not ar.length
)
result.length === 0
(which is not what you want in this case)
hello911 sends brownie points to @taltmann42 :sparkles: :thumbsup: :sparkles:
:cookie: 485 | @taltmann42 |http://www.freecodecamp.com/taltmann42
amitp88 sends brownie points to @taltmann42 :sparkles: :thumbsup: :sparkles:
:warning: amitp88 already gave taltmann42 points
kev-cs sends brownie points to @luiko :sparkles: :thumbsup: :sparkles:
:cookie: 396 | @luiko |http://www.freecodecamp.com/luiko
function makeFriendlyDates(arr) {
var monthKeys = {
01 : "January",
02 : "February",
03 : "March",
04 : "April",
05 : "May",
06 : "June",
07 : "July",
08 : "August",
09 : "September",
10 : "October",
11 : "November",
12 : "December"
};
function addEnd(num){
switch (num){
case "1":
return num + "st";
case "2":
return num + "nd";
case "3":
return num + "rd";
default:
return num + "th";
}
}
function convertDates (str){
var date = str.split("-");
var dateObj = {};
dateObj.year = date[0];
dateObj.month = monthKeys[parseInt(date[1],8)];
dateObj.day = addEnd(date[2].substr(1,date[2].length));
return dateObj;
}
var dateOne = convertDates(arguments[0][0]);
var dateTwo = convertDates(arguments[0][1]);
console.log(dateOne);
console.log(dateTwo);
var result = [];
if(dateOne.year === "2016"){
if(dateTwo.year === "2016"){
result.push(dateOne.month + " " + dateOne.day + ", " + dateTwo.day);
return result;
}
}
}
makeFriendlyDates(['2016-07-01', '2016-07-04']);
<div class="col-md-8 col-md-offset-4">
<h3> Timeline of life of Ma Yuan</h3>
<ul>
<li> born in 1970</li>
</ul>
</div>
<div class="col-md-10 col-md-offset-2">
Hello! What's wrong with this code
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="refresh" content="1">
</head>
<body id="thebody" onload="show_pattern()">
<div id="div" style="position:absolute"></div>
</body>
<script>
function show_pattern(){
var y=25, x=25;
var width=500, height=500;
var rand_color;
var colors=["red","green","yellow","blue","olive","black"];
var the_body=document.getElementById("thebody");
while(width>30){
var this_div=document.getElementById("div");
var this_body=document.getElementById("thebody");
this_div.style.left=x+'px';
this_div.style.top=y +'px';
this_div.style.height=height +'px';
this_div.style.width=width +'px';
rand_color=Math.floor(Math.random()*6);
this_div.style.background=colors[rand_color];
the_body.appendChild(this_div);
x=x+25;
y=y+25;
width-=50 +'px';
height-=50 +'px';
}
}
</script>
</html>
Help please
Any good way to nicely increment this ? https://gist.github.com/phumberdroz/98819f2eb31c931b9c37954f90d36f96
see line 5, 6, 9 and then 16, 17, 20
0livier1o1 sends brownie points to @pizzapokerguy :sparkles: :thumbsup: :sparkles:
:cookie: 333 | @pizzapokerguy |http://www.freecodecamp.com/pizzapokerguy
pizzapokerguy sends brownie points to @jtan3 :sparkles: :thumbsup: :sparkles:
:cookie: 304 | @jtan3 |http://www.freecodecamp.com/jtan3
@dkohlruss sorry again for extend the space, @kurumkan thank you , just one more question, i didn't learn this usage before, and it is still in html, i saw the coder used some @ signs in CSS too ,@use postcss-nested;
@use autoprefixer;
@use postcss-simple-vars;
@use postcss-discard-comments;
$fargglad:#722872;
$morkfarg:#592059;
$morkgra:#888;
jay397 sends brownie points to @dkohlruss and @kurumkan and @use :sparkles: :thumbsup: :sparkles:
:warning: could not find receiver for use
:cookie: 381 | @kurumkan |http://www.freecodecamp.com/kurumkan
:cookie: 174 | @dkohlruss |http://www.freecodecamp.com/dkohlruss
jktravis sends brownie points to @aj-willi :sparkles: :thumbsup: :sparkles:
:cookie: 264 | @aj-willi |http://www.freecodecamp.com/aj-willi
preprocessors
. The one for HTML probably being Jade (nowadays called pug
templates.) The one for css probably SASS.
jtan3 sends brownie points to @alpox :sparkles: :thumbsup: :sparkles:
:cookie: 767 | @alpox |http://www.freecodecamp.com/alpox
color
is for the font-color, if you want to change the background-color of an element, you have to use background-color
color
should be fine... do you have a link to the codepen?
ssharps711 sends brownie points to @jktravis :sparkles: :thumbsup: :sparkles:
:cookie: 355 | @jktravis |http://www.freecodecamp.com/jktravis
@berndbausch you probably won't need any of that. This is an example tweet:
https://twitter.com/intent/tweet?text=The%20next%20time%20you%20raise%20a%20hand%20to%20me%20will%20be%20the%20last%20time%20you%20have%20hands
so you only have to build the URL with the text
-parameter and set it as href
for an <a>
tag
radekjohn sends brownie points to @berndbausch :sparkles: :thumbsup: :sparkles:
:cookie: 3 | @berndbausch |http://www.freecodecamp.com/berndbausch
berndbausch sends brownie points to @taltmann42 and @radekjohn :sparkles: :thumbsup: :sparkles:
:cookie: 265 | @radekjohn |http://www.freecodecamp.com/radekjohn
:cookie: 488 | @taltmann42 |http://www.freecodecamp.com/taltmann42
$("#output").prepend("
radekjohn sends brownie points to @taltmann42 :sparkles: :thumbsup: :sparkles:
:cookie: 489 | @taltmann42 |http://www.freecodecamp.com/taltmann42
$("#output").html("")
before entering the loop, this will delete the content from the output
radekjohn sends brownie points to @taltmann42 :sparkles: :thumbsup: :sparkles:
:warning: radekjohn already gave taltmann42 points
vilfredsikker sends brownie points to @jaketh :sparkles: :thumbsup: :sparkles:
:cookie: 331 | @jaketh |http://www.freecodecamp.com/jaketh