zenzate sends brownie points to @alan-redding :sparkles: :thumbsup: :sparkles:
:cookie: 253 | @alan-redding |http://www.freecodecamp.com/alan-redding
idallenbach sends brownie points to @tylermoeller :sparkles: :thumbsup: :sparkles:
:star2: 1425 | @tylermoeller |http://www.freecodecamp.com/tylermoeller
var string=[["t","w","o"],["t","e","a"]];
console.log(string.length());
Computer says there is no such function as string.length(); why?
http://codepen.io/chocolatechimpcookie/pen/dNZvNP
chocolatechimpcookie sends brownie points to @tylermoeller :sparkles: :thumbsup: :sparkles:
:star2: 1426 | @tylermoeller |http://www.freecodecamp.com/tylermoeller
hello911 sends brownie points to @chocolatechimpcookie :sparkles: :thumbsup: :sparkles:
:cookie: 269 | @chocolatechimpcookie |http://www.freecodecamp.com/chocolatechimpcookie
hey guys, I'm trying to setup my containers to create a dynamic menu for a restaurant website and I need a little help.
here are my container variables
what i'm trying to do in the picture is place the 3 variables indicated in red in the HTMLdishInfoContainer variable where %data% is. my question is, how do I replace the %data% in the HTMLdishInfoContainer variable with multple variables?
var x = <h1>data</h1><h2>data</h2>...
amitp88 sends brownie points to @mot01 :sparkles: :thumbsup: :sparkles:
:cookie: 480 | @mot01 |http://www.freecodecamp.com/mot01
dishinfocontainer = '<div class="menu-info">" + variable, variable, variable + "</div>';
function titleCase(str) {
var string=str.split(" ");
for(var i=0;i<string.length;i++){
string[i].toLowerCase();
}
return string;
}
titleCase("I'M A liTtle tEa pot");
Why is the function returning a array of words, unchanged from the string? How should I make the toLowerCase() method work?
var string = str.toLowerCase();
hello911 sends brownie points to @mot01 :sparkles: :thumbsup: :sparkles:
:cookie: 481 | @mot01 |http://www.freecodecamp.com/mot01
remdata sends brownie points to @mot01 :sparkles: :thumbsup: :sparkles:
:cookie: 482 | @mot01 |http://www.freecodecamp.com/mot01
rami90 sends brownie points to @lorrie01 :sparkles: :thumbsup: :sparkles:
:cookie: 309 | @lorrie01 |http://www.freecodecamp.com/lorrie01
bitcoinabdi sends brownie points to @lorrie01 :sparkles: :thumbsup: :sparkles:
:cookie: 310 | @lorrie01 |http://www.freecodecamp.com/lorrie01
Hi guys i have been stuck with this please help, what is wrong with my code..the last test is not passing
Sum all the prime numbers up to and including the provided number.
A prime number is defined as a number greater than one and having only two divisors, one and itself. For example, 2 is a prime number because it's only divisible by one and two.
The provided number may not be a prime.
sumPrimes(10) should return a number.
sumPrimes(10) should return 17.
sumPrimes(977) should return 73156.
function sumPrimes(num) {
var prime = [];
for(i = 2; i <= num; i++) {
if(i == 2 || i == 3 || i == 5 || i == 7) {
prime.push(i);
}else {
if(i % 2 === 0 || i % 3 === 0 || i % 4 === 0 || i % 5 === 0 || i % 7 === 0) {
continue;
}else {
prime.push(i);
}
}//end else
}//end for
num = prime.reduce(function(prev, curr) {
return prev + curr;
}, 0);
return num;
}
sumPrimes(977);
stevo99 sends brownie points to @lorrie01 :sparkles: :thumbsup: :sparkles:
:cookie: 311 | @lorrie01 |http://www.freecodecamp.com/lorrie01
A little simple, but here is my Random Quote Machine if anybody wants to comment on it! Audio does not work on Safari though because of the .ogg audio from the Wikia.
if (a bunch of crap === true) {
do a bunch of crap
} else {
do lots of this other crap
}
@KerryW1 body {
padding-top:70px;
}
.navbar-header {
float: none;
}
.navbar-toggle {
display: block;
}
.navbar-collapse.collapse {
display: none!important;
}
.navbar-nav {
float: none!important;
}
.navbar-nav>li {
float: none;
}
.navbar-collapse.collapse.in{
display:block !important;
}
table td{
padding: 10px;
}
@philiplee15 something like:
div.col-xs-12{
background-color: #eee;
}
if that you want
function apiLookup(term, name) {
$.getJSON(api + apiTerms[term] + '/' + name + '?callback=?', function(data) {
return data;
})
}
data
to another function because getJSON is asynchronous
:cookie: 66 | @skycoder01 |http://www.freecodecamp.com/skycoder01
chriswingler sends brownie points to @skycoder01 :sparkles: :thumbsup: :sparkles:
chriswingler sends brownie points to @skycoder01 :sparkles: :thumbsup: :sparkles:
:warning: chriswingler already gave skycoder01 points
Hi Guys! Can anyone check my code here?
https://codepen.io/JDVariadic/pen/wWNqQW
I've managed to get the geolocation code to work yesterday; however, it doesn't seem to work now and there is nothing appearing at the center box.
<nav class="navigation">
<ul>
<li>
<a href="a">Solucoes</a>
<div class="nav-content">
<div class="nav-sub">
<ul>
<li><a href="#">Internet Dedicada Corporativa</a></li>
<li><a href="#">Transmissao de Dados</a></li>
<li><a href="#">IP-MPLS</a></li>
<li><a href="#">M2M</a></li>
<li><a href="#">Alojamento</a></li>
</ul>
</div>
</div>
<li>
<a href="a">Voz</a>
</li>
<li>
<a href="a">Internet</a>
</li>
<li>
<a href="a">Ready Business</a>
</li>
</ul>
</nav>
margin: 0px auto
(that means top and bottom margin for the element is 0px, and left and right should be set automatically by the browser, which means it will get centered in this case).
ingundela sends brownie points to @nitinnair89 :sparkles: :thumbsup: :sparkles:
:cookie: 386 | @nitinnair89 |http://www.freecodecamp.com/nitinnair89
body {
font-family: 'Roboto Slab', serif;
font-size: 30px;
background: linear-gradient(lightcoral, whitesmoke);
}
Grrr, why is this doing nothing to my background?
https://plnkr.co/edit/O1KOUfiGGuYCCbdBqRAW?p=preview
i am having issues with placing this image in the html
especially in the local path
it disturbs all the layout
divs are skewed
transform: skewY( 7deg);
is skewing the div
.carousel:after{
content: '';
width: 100%;
height: 100%;
position: absolute;
background: inherit;
z-index: 0;
transform-origin: right bottom;
transform: skewY( 7deg);
}
<div class="carousel">
<div class="image-carousel">
<img src="assets/img/graph.png" />
</div>
</div>
<div class="carousel"></div>
<!DOCTYPE html>
<html>
<head>
<link rel="stylesheet" href="style.css">
<script src="script.js"></script>
</head>
<div class="header-image">
</div>
<div class="carousel">
<div class="image">
<img src="https://photos-1.dropbox.com/t/2/AACeWkvAnAKick9mL19BFfAqhN0awzonUtSnUzd6Fff49Q/12/11126057/jpeg/32x32/3/1485698400/0/2/carousel_slide1.jpg/EO2spQgYnsMFIAIoAg/XY07dYeH5Js9GsFciYCZ-FlNQSG04KeD27pwMzkb9MY?dl=0&size=1280x960&size_mode=3" /> </div>
</div>
<div class="title">
</div>
</html>
$(document).ready(function() {
$.ajax({
url: "http://api.openweathermap.org/data/2.5/weather?lat=35&lon=139&appid=8e83f5c253e4e52246b437596d46c1e8",
success: function(data){
alert("Test!");
}
});
});
cambscoder sends brownie points to @nitinnair89 :sparkles: :thumbsup: :sparkles:
:cookie: 387 | @nitinnair89 |http://www.freecodecamp.com/nitinnair89
Origin: header is required
$('#wiki').append(
`<a href=${url+pages[i].pageid} class="article" target="_blank">
<div>
${pages.thumbnail ? <img class="align-right" src=${pages.thumbnail.source} /
chungeric sends brownie points to @ghulamshabir :sparkles: :thumbsup: :sparkles:
:star2: 1767 | @ghulamshabir |http://www.freecodecamp.com/ghulamshabir
<a href="...">...</a>
or sub-menus to your li
's for it to go anywhere.
margin-left: -200px
for instance, try and remove that as @NitinNair89 suggests
dadleatherwood sends brownie points to @nawkin :sparkles: :thumbsup: :sparkles:
:cookie: 120 | @nawkin |http://www.freecodecamp.com/nawkin
dadleatherwood sends brownie points to @voxgranular :sparkles: :thumbsup: :sparkles:
:cookie: 210 | @voxgranular |http://www.freecodecamp.com/voxgranular
<script src="..."></script>
in your HTML. the jQuery script reference should come before typed.js & your bootstrap.js
bigyankarki sends brownie points to @faddah :sparkles: :thumbsup: :sparkles:
:cookie: 118 | @faddah |http://www.freecodecamp.com/faddah
<link stylesheet="..." />
in the <body>
of your HTML, they should be between <head>
tags above the <body>
. still looking at why your anchor tags from the navbar aren't working...
nawkin sends brownie points to @faddah :sparkles: :thumbsup: :sparkles:
:cookie: 119 | @faddah |http://www.freecodecamp.com/faddah
<link stylesheet="..." ... />
to the top, which is good, but it needs to be between <head> ... </head>
tags.
<body>...</body>
tags. Everything else should be placed in the pen settings
<link styleshee="..." />
or <script>
tags in your HTML or in their codepen settings interface, either will work. i've done both, both work fine.
<script>
tags correctly, and know the right order they need to be in for them to work, but that is true in any implementation of HTML/CSS.
#portfolio {
padding-top: 100px;
}
nawkin sends brownie points to @mot01 :sparkles: :thumbsup: :sparkles:
:cookie: 483 | @mot01 |http://www.freecodecamp.com/mot01
<section id="about">
wrapping up the necessary elements. This will also make your HTML DOM good
#about {
padding-top:70px;
}
display:block;
or something instead of inline
and that's why it appears on next line
json
data you retrieve as a function argument.
$(document).ready(function(){
function getQuote(){
// my getJSON call goes here
displayQuote(response); // call a function and pass the response from getJSON
};
function displayQuote(data){
//update HTML element values here using 'data' variable.
};
});
.typed-cursor{
opacity: 1;
-webkit-animation: blink 0.7s infinite;
-moz-animation: blink 0.7s infinite;
animation: blink 0.7s infinite;
}
@keyframes blink{
0% { opacity:1; }
50% { opacity:0; }
100% { opacity:1; }
}
@-webkit-keyframes blink{
0% { opacity:1; }
50% { opacity:0; }
100% { opacity:1; }
}
@-moz-keyframes blink{
0% { opacity:1; }
50% { opacity:0; }
100% { opacity:1; }
}
<span class="typed-cursor"></span><span class="heading"></span>
bigyankarki sends brownie points to @nitinnair89 :sparkles: :thumbsup: :sparkles:
:cookie: 388 | @nitinnair89 |http://www.freecodecamp.com/nitinnair89
bigyankarki sends brownie points to @nitinnair89 :sparkles: :thumbsup: :sparkles:
:warning: bigyankarki already gave nitinnair89 points
({position: absolute;}, {top: 50px})
for example
function online(data) {
console.log(data)
if (data.stream !== null && data.stream !== undefined) {
$('#results').append(data.name);
}
}
function apiLookup(term1, term2, name, callback) {
$.getJSON(api + apiTerms[term1] + '/' + name + '?callback=?', callback)
$.getJSON(api + apiTerms[term2] + '/' + name + '?callback=?', callback)
}
for (var i = 0; i < user.length; i++) {
apiLookup('users', 'streams', user[i], online);
}
data.stream.channel.name
to get the name
||
instead of &&
: if(data.stream !== null && data.stream !== undefined) {`
:cookie: 484 | @mot01 |http://www.freecodecamp.com/mot01
:star2: 1427 | @tylermoeller |http://www.freecodecamp.com/tylermoeller
chriswingler sends brownie points to @tylermoeller and @mot01 :sparkles: :thumbsup: :sparkles:
bomholt sends brownie points to @tylermoeller :sparkles: :thumbsup: :sparkles:
:star2: 1428 | @tylermoeller |http://www.freecodecamp.com/tylermoeller
:cookie: 191 | @davidakoch |http://www.freecodecamp.com/davidakoch
mml3b sends brownie points to @davidakoch :sparkles: :thumbsup: :sparkles:
davidakoch sends brownie points to @mml3b :sparkles: :thumbsup: :sparkles:
:cookie: 139 | @mml3b |http://www.freecodecamp.com/mml3b
$(".btn").replaceWith("<input type="text" class="form-control" id="inputField" placeholder= "Search"></input>");
math.random()
gives a random number between 0 and 1 i believe
math.floor()
rounds down to the closest integer i believe
"
inside of a string, you have to use different begin and terminating quotes -- use '
the single quote at the beginning and end:'This is some "string" with " quotes'
this api projects suck apis wont work for free there are no easyfree options
http://
instead of https://
navigator.geolocation.getCurrentPosition
because it depends on https.sharang108 sends brownie points to @alpox :sparkles: :thumbsup: :sparkles:
:cookie: 753 | @alpox |http://www.freecodecamp.com/alpox
<nav class="menu">
<ul>
<li><a href="default.solucoes">Solucoes</a>
<nav class="sub-menu">
<ul>
<li><a href="#">Internet Dedicada Corporativa</a></li>
<li><a href="#">Transmissao de Dados</a></li>
<li><a href="#">IP-MPLS</a></li>
<li><a href="#">M2M</a></li>
<li><a href="#">Alojamento</a></li>
</ul>
</Nav>
</li>
<li><a href="default.ready business">Ready Business</a></li>
<li><a href="default.ready business">Parceiros</a></li>
<li><a href="default.voz">Suporte</a></li>
</ul>
</nav>
done(data =>
displayLoc(data.lat, data.lon,
.done(function(data) {})
allisonmahmood sends brownie points to @harshil1712 :sparkles: :thumbsup: :sparkles:
:cookie: 324 | @harshil1712 |http://www.freecodecamp.com/harshil1712
function(data)
:$.getJSON(url, function(data) {
// do something with data
}).done(function(data){
// do some more stuff with data
}).fail(function(err) {
// log errors
});
$.getJSON(url, data => {
// do something with data
}).done(data => {
// do some more stuff with data
}).fail(err => {
// log errors
});
:cookie: 325 | @harshil1712 |http://www.freecodecamp.com/harshil1712
:cookie: 254 | @alan-redding |http://www.freecodecamp.com/alan-redding
ingundela sends brownie points to @harshil1712 and @alan-redding :sparkles: :thumbsup: :sparkles:
https://api.wunderground.com/api/API_KEY/conditions/q/autoip.json
Hello Guys !
I am having issue with Weather API, I m trying to get my city name from the JSON api. But it fails at converting JSON to HTML...
getJSON
the result is already an object. Just skip this part: obj = JSON.stringify(json);
:cookie: 386 | @gbsimon87 |http://www.freecodecamp.com/gbsimon87
casdidier sends brownie points to @gbsimon87 and @alpox :sparkles: :thumbsup: :sparkles:
:cookie: 754 | @alpox |http://www.freecodecamp.com/alpox
"json.name"
without quotes
json.name
});
too much :-)
@casdidier always check devtools / console
if something doesnt work.. probably have errors...
Mixed Content: The page at 'https://codepen.io/ddcas/pen/zNpxMX?editors=0010' was loaded over HTTPS, but requested an insecure XMLHttpRequest endpoint 'http://api.openweathermap.org/data/2.5/weather?id=3037456&APPID=6a658928bb00556b756c4018538cefbc'. This request has been blocked; the content must be served over HTTPS.
http://
instead of https://
and it works
casdidier sends brownie points to @moigithub and @alpox :sparkles: :thumbsup: :sparkles:
:warning: casdidier already gave alpox points
:star2: 2629 | @moigithub |http://www.freecodecamp.com/moigithub
<script>
tags
<div class="container-fluid">
<div class = "row text-center">
<h2>Cat Photo Finder</h2>
</div>
<div class = "row text-center">
<div class = "col-xs-12 well message">
The message will go here
</div>
</div>
<div class = "row text-center">
<div class = "col-xs-12">
<button id = "getMessage" class = "btn btn-primary">
Get Message
</button>
</div>
</div>
</div>
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.1.0/jquery.min.js"></script>
<script>
$(document).ready(function() {
$("#getMessage").on("click", function(){
// Only change code below this line.
$(".message").html("Here is the message");
// Only change code above this line.
});
});
</script>
mindwhys sends brownie points to @tylermoeller and @taltmann42 :sparkles: :thumbsup: :sparkles:
:star2: 1430 | @tylermoeller |http://www.freecodecamp.com/tylermoeller
:cookie: 405 | @taltmann42 |http://www.freecodecamp.com/taltmann42
mindwhys sends brownie points to @tylermoeller and @taltmann42 :sparkles: :thumbsup: :sparkles:
:warning: mindwhys already gave tylermoeller points
:warning: mindwhys already gave taltmann42 points