achudoz sends brownie points to @rallph :sparkles: :thumbsup: :sparkles:
:cookie: 280 | @rallph |http://www.freecodecamp.com/rallph
cache: false
in their .ajax call. I don't know why they don't do the same for the $.getJSON code example, but if you add $.ajaxSetup({cache:false});
, you should get a new quote every time.
achudoz sends brownie points to @skycoder01 :sparkles: :thumbsup: :sparkles:
:cookie: 208 | @skycoder01 |http://www.freecodecamp.com/skycoder01
achudoz sends brownie points to @skycoder01 :sparkles: :thumbsup: :sparkles:
:warning: achudoz already gave skycoder01 points
a
variable function(a)
, then you can parse a
to get what you want from it. Lots of magic I don't understand going on behind the scenes though, that's for sure :)
document.getElementById
for both and remove the #
:const btn = document.getElementById('btn');
const quote= document.getElementById('quote');
Can somebody please help me with Comparisons with the Logical And Operator in JavaScript? Here is my code:
function testLogicalAnd(val) {
// Only change code below this line
if (val && 25) {
if (val && 50) {
return "Yes";
}
}
// Only change code above this line
return "No";
}
// Change this value to test
testLogicalAnd(10);
Also, here is the link: https://www.freecodecamp.com/challenges/comparisons-with-the-logical-and-operator
yuchiu sends brownie points to @skycoder01 :sparkles: :thumbsup: :sparkles:
:cookie: 209 | @skycoder01 |http://www.freecodecamp.com/skycoder01
@mcube25 Your code line
document.getElementById('outPut').value=firstValue+'operator'+secondValue+'=';
outputs the string "operator"
@berndbausch I see what's happening, with a form, you have to use event.preventDefault() to submit the information.
$("#searchform").submit(function(event){
event.preventDefault();
After adding that, I get a cross-origin error.Cross-Origin Request Blocked: The Same Origin Policy disallows reading the remote resource at https://en.wikipedia.org/w/api.php?action=opensearch&format=json&search=test. (Reason: CORS header ‘Access-Control-Allow-Origin’ missing).
&origin=*
to your URL
berndbausch sends brownie points to @skycoder01 :sparkles: :thumbsup: :sparkles:
:cookie: 210 | @skycoder01 |http://www.freecodecamp.com/skycoder01
=
signs and they go to the normal color for me
@mcube25 You do
if (operator===-100){
operator=value;
I think you need to correct that, but I wouldn't know what's wrong and how to make it right.
fuscobite sends brownie points to @berndbausch :sparkles: :thumbsup: :sparkles:
:cookie: 4 | @berndbausch |http://www.freecodecamp.com/berndbausch
navbar-fixed-top
?
padding-top: 100px
or something about that size to the body, it would work?
body
CSS selector.
@bigyankarki - one thing that I think you have happening, besides that fixed navbar, is that you are displaying the search results in reverse order. The closest hit on the search is at the bottom.
I did this in the CSS panel:
body {
font-family: 'Julius Sans One', sans-serif;
padding-top: 100px;
}
You can probably add it in different places and get the same effect.
.prepend
-ing
.append
puts them in the right order.
:star2: 2485 | @khaduch |http://www.freecodecamp.com/khaduch
bigyankarki sends brownie points to @khaduch :sparkles: :thumbsup: :sparkles:
$("#thisForm").submit(function(event){
event.preventDefault();
$("#inputField").animate({
top: '100px'
});
var input = $('#inputField').val();
getData(input);
console.log(input);
});
ul.nav-pills li{
margin: 0 15px;
}
<h2 aling="text-right">About</h2>
itchick85 sends brownie points to @adityaparab :sparkles: :thumbsup: :sparkles:
:cookie: 942 | @adityaparab |http://www.freecodecamp.com/adityaparab
itchick85 sends brownie points to @jtan3 :sparkles: :thumbsup: :sparkles:
:cookie: 309 | @jtan3 |http://www.freecodecamp.com/jtan3
millen812 sends brownie points to @jtan3 :sparkles: :thumbsup: :sparkles:
:cookie: 310 | @jtan3 |http://www.freecodecamp.com/jtan3
myteststudy sends brownie points to @mrpuer :sparkles: :thumbsup: :sparkles:
:cookie: 267 | @mrpuer |http://www.freecodecamp.com/mrpuer
Promise.all
$.when
See examples(scroll to bottom) here https://api.jquery.com/jquery.when/
jquery
case 7:if(board[2][10] != 'X'
sounds big wrong - i don't think there is a place on the board with index 10
display();
after computersTurn();
in the main function
int index = rand() % (8 + 1);
gives you a number between 0 and 8 - not 1-9 which you handle in computersOutput
1 2 3
4 5 6
7 8 9
Player X's turn: Select the number to place X
5
1 2 3
4 X 6
7 8 9
1 2 O
4 X 6
7 8 9
Player X's turn: Select the number to place X
cout << endl << endl;
or something like that :-)
Mates I've to store the value from an input box and use that value into an ajax request... I'm not able to store the value...
var value = document.getElementById("utente").value;
using this
1 2 3
4 5 6
7 8 9
Player X's turn: Select the number to place X
4
1 2 3
X 5 6
7 8 9
Computer Played
1 2 O
X 5 6
7 8 9
Player X's turn: Select the number to place X
5
1 2 O
X X 6
7 8 9
Computer Played
1 2 O
X X O
7 8 9
Player X's turn: Select the number to place X
9
1 2 O
X X O
7 8 X
Computer Played
1 2 O
X X O
O 8 X
Player X's turn: Select the number to place X
8
1 2 O
X X O
O X X
Computer Played
1 2 O
X O O
O X X
Player X's turn: Select the number to place X
2
1 X O
X O O
O X X
Computer Played
1 X O
utente
?
void computersTurn(){
cTurn = true;
bool computerPlayed = false;
do
int index = rand() % (8 + 1);
computerPlayed = computersOutput(index);
} while(!computerPlayed);
cTurn = false;
}
computersOutput
function to return a boolean which indicated whether it could or could not set the value to the board
bool computersOutput(int index){
computersOutput
returns a boolean indicating whether or not it was able to set at the given random location.computersOutput
function can be simplified since you have a one-dimensional array which you use as two-dimensional.Guys i have a h2 title that is more or less something like this
<hr><h2>SPACE</h2><hr>
What happens with my font settings is that SPACE creates an extra space after each letter (through letter-spacing).
So, the problems with this is that the rightmost <hr> is pushed to the right a bit and it sort of makes things ...off. (like this -- S P A C E -- , but no as exagerated)
So, i'd just like the rightmost HR to overlap the last letter's space. Is that possible?
hr
and and then a h2
and move the h2
on top of the hr
through css (position: relative; top: -30px
as example), then set the background of the h2
to white
(or whatever your background is)
st3ps sends brownie points to @alpox :sparkles: :thumbsup: :sparkles:
:cookie: 770 | @alpox |http://www.freecodecamp.com/alpox
hr
while going sure that the hr
does not go right through.
hr
though:
blackioo sends brownie points to @alpox :sparkles: :thumbsup: :sparkles:
:cookie: 771 | @alpox |http://www.freecodecamp.com/alpox
img-fluid
.img {
border-radius: 100%;
}
blackioo sends brownie points to @alpox :sparkles: :thumbsup: :sparkles:
:warning: blackioo already gave alpox points
@Krimsonmedic Chrome blocks your call to navigator.geolocation.getCurrentPosition
since they newly allow that only in a secure environment https://
But you cannot use https://
when working with openweatherapp since that is not in their free plan.
You gotta use either some other weather api or another location api. Most people go with another location api like http://ip-api.com/
hr, h1 { display: block; }
and try again.h1
doesn't do much as normal inline element.
feuerbird29 sends brownie points to @st3ps :sparkles: :thumbsup: :sparkles:
:cookie: 363 | @st3ps |http://www.freecodecamp.com/st3ps
hey guys, im on "Show the Local Weather" exercise and im a bit stuck..
it askes me to use an api call and get the current weather for the users location..
iv'e got the exercise work on netBeans and a local brauzer,and used "navigator.geolocation.getCurrentPosition" to get the users current position..
the exercise ask me to upload it to "CodePen",
but codePen blocks it with this error:
"getCurrentPosition() and watchPosition() no longer work on insecure origins. To use this feature, you should consider switching your application to a secure origin, such as HTTPS. See https://goo.gl/rStTGz for more details.
getWeather @ pen.js:2358"
is there a wey to upload it to CodePen?
or is there another function you would recommend to get users current position?
css("propertyname","value");
you should have one property name and one value
st3ps sends brownie points to @alpox :sparkles: :thumbsup: :sparkles:
:cookie: 772 | @alpox |http://www.freecodecamp.com/alpox
edson-rodrigues sends brownie points to @alpox :sparkles: :thumbsup: :sparkles:
:cookie: 773 | @alpox |http://www.freecodecamp.com/alpox
top:0;
to .navigation
rule
oppiniated sends brownie points to @usernmae :sparkles: :thumbsup: :sparkles:
:warning: @usernmae's account is not linked with freeCodeCamp. Please visit the settings and link your GitHub account.
```
<div class = "classhere?">
<div class = "classhere?">
.container-fluid
its a predefined bootstrap's class.
<center><title>dasdfsdf</title></center>
fredd93 sends brownie points to @heydante :sparkles: :thumbsup: :sparkles:
:cookie: 428 | @heydante |http://www.freecodecamp.com/heydante
drbathound sends brownie points to @deanhollstrom :sparkles: :thumbsup: :sparkles:
:cookie: 122 | @deanhollstrom |http://www.freecodecamp.com/deanhollstrom
blackioo sends brownie points to @alpox :sparkles: :thumbsup: :sparkles:
:cookie: 774 | @alpox |http://www.freecodecamp.com/alpox
right: ...
on that div instead of single buttons
bebesel sends brownie points to @alpox :sparkles: :thumbsup: :sparkles:
:cookie: 775 | @alpox |http://www.freecodecamp.com/alpox
I'm working on the portfolio page: https://www.freecodecamp.com/challenges/build-a-personal-portfolio-webpage
#5 says to put thumbnail images of different projects, or put placeholders. How do I do placeholders?
jampcat9 sends brownie points to @alpox :sparkles: :thumbsup: :sparkles:
:cookie: 776 | @alpox |http://www.freecodecamp.com/alpox
hey guys, im on "Show the Local Weather" exercise and im a bit stuck..
it askes me to use an api call and get the current weather for the users location..
iv'e got the exercise work on netBeans and a local brauzer,and used "navigator.geolocation.getCurrentPosition" to get the users current position..
the exercise ask me to upload it to "CodePen",
but codePen blocks it with this error:
"getCurrentPosition() and watchPosition() no longer work on insecure origins. To use this feature, you should consider switching your application to a secure origin, such as HTTPS. See https://goo.gl/rStTGz for more details.
getWeather @ pen.js:2358"
is there a wey to upload it to CodePen?
or is there another function you would recommend to get users current position?
shaytamir sends brownie points to @alpox :sparkles: :thumbsup: :sparkles:
:cookie: 777 | @alpox |http://www.freecodecamp.com/alpox
inline
or inline-block
element or a block
element whose parents have no exact size.rsxhoxhi sends brownie points to @jonylif :sparkles: :thumbsup: :sparkles:
:cookie: 73 | @jonylif |http://www.freecodecamp.com/jonylif
guys can you please check if my clock is working? all functions alright? does it look nice too? would you guys say it's a finished project? http://codepen.io/EvanDCP18/full/bgZZqm/
evandcp sends brownie points to @skycoder01 :sparkles: :thumbsup: :sparkles:
:cookie: 212 | @skycoder01 |http://www.freecodecamp.com/skycoder01
evandcp sends brownie points to @skycoder01 :sparkles: :thumbsup: :sparkles:
:warning: evandcp already gave skycoder01 points
ReturnToSender.eot
, like I said earlier, you need to upload those files somewhere and access them via URL or local file path if you're running everything locally. https://www.fontspring.com/support/installing_webfonts/how-do-i-use-the-webfonts
evandcp sends brownie points to @skycoder01 :sparkles: :thumbsup: :sparkles:
:warning: evandcp already gave skycoder01 points
r.bind
is not a function
</section>
</div>
fvdave2017 sends brownie points to @skycoder01 :sparkles: :thumbsup: :sparkles:
:cookie: 213 | @skycoder01 |http://www.freecodecamp.com/skycoder01
If that still doesn't work, you may also need to initialize it with JavaScript @fvdave2017
$('body').scrollspy({target: '.navbar'});
Hard to tell without seeing your entire project.
fvdave2017 sends brownie points to @skycoder01 :sparkles: :thumbsup: :sparkles:
:warning: fvdave2017 already gave skycoder01 points
srichakradhar sends brownie points to @kirbyedy :sparkles: :thumbsup: :sparkles:
:star2: 1795 | @kirbyedy |http://www.freecodecamp.com/kirbyedy
linearg sends brownie points to @jacketh :sparkles: :thumbsup: :sparkles:
:warning: @jacketh's account is not linked with freeCodeCamp. Please visit the settings and link your GitHub account.
brigette-eckert sends brownie points to @skycoder01 :sparkles: :thumbsup: :sparkles:
:cookie: 216 | @skycoder01 |http://www.freecodecamp.com/skycoder01
isStreaming
addChannel
part
function success(position) {
latitude = position.coords.latitude;
longitude = position.coords.longitude;
}
function error() {
$('#output').text("Error: geolocation is not supported.");
}
navigator.geolocation.getCurrentPosition(success, error);
});
$.getJSON(url, function(data) {
var foo = data.bar;
var bar = data.foo;
someOtherFunction(foo, bar);
});
function someOtherFunction(foo, bar) {
console.log(foo);
console.log(bar);
}
$.getJSON(url, someOtherFunction);
function someOtherFunction(data) {
console.log(data.foo);
console.log(data.bar);
}
aviendhaast sends brownie points to @skycoder01 :sparkles: :thumbsup: :sparkles:
:cookie: 217 | @skycoder01 |http://www.freecodecamp.com/skycoder01
<header>
<link
href='https://fonts.googleapis.com/css?family=Lobster' rel='stylesheet' type='text/css'>
</header>
<div class="container-fluid">
<ul class="nav nav-pills">
<li>
<a href="#">Richard Aird</a>
</li>
<li class ="pull-right">
<a href="#">About Me</a>
</li>
<li class ="pull-right">
<a href="#">Portfolio</a>
</li>
<li class ="pull-right">
<a href="#">Youtube</a>
</li>
<li class ="pull-right">
<a href="#">Contact Me</a>
</li>
</ul>
<div class="pageOne">
<h1>Richard Aird</h1></div>
</div>
function success(position) {
latitude = position.coords.latitude;
longitude = position.coords.longitude;
}
function error() {
$('#output').text("Error: geolocation is not supported.");
}
navigator.geolocation.getCurrentPosition(success, error);
($'#output').text(success.latitude);
});
($'#output').text(success.latitude)
would have to be inside your success() function.
aviendhaast sends brownie points to @skycoder01 :sparkles: :thumbsup: :sparkles:
:warning: aviendhaast already gave skycoder01 points
.nav-pills{
font-size:1.7em;
background-color:black;
}
body{
background-color:white;
font-family:Lobster;
color:white;
}
h1{
padding:0;
margin-top:0px;
}
.pageOne{
background:url(https://images.unsplash.com/photo-1444703686981-a3abbc4d4fe3?dpr=1&auto=format&fit=crop&w=1500&h=1000&q=80&cs=tinysrgb&crop=);
background-size:cover;
height:800px;
}
boxxylol sends brownie points to @skycoder01 :sparkles: :thumbsup: :sparkles:
:cookie: 218 | @skycoder01 |http://www.freecodecamp.com/skycoder01
x | x |
---|---|
x | x |
makeOptimalMove()
You can see the unfinished conditionals I have in that function.
hi! can someone please help me what's wrong with this code? <form action="/submit-cat-photo</form>"
<input type="text" placeholder="cat photo URL">
</form>
evandcp sends brownie points to @freakishlancer and @tylermoeller :sparkles: :thumbsup: :sparkles:
:cookie: 375 | @freakishlancer |http://www.freecodecamp.com/freakishlancer
:star2: 1492 | @tylermoeller |http://www.freecodecamp.com/tylermoeller
Hi everyone, can you help me with my Local Weather App? I've finally got the API call working, and I'm trying to output certain values to fields in my HTML document. Two of the outputs are working, but the final one isn't.
Here's the link to my CodePen and here is the relevant bit of code:
function(json) {
$("#user-location").html(json.name);
$("#user-temperature").html(json.main.temp);
$("#user-weather").html(json.weather.description);
});
The location and temperature are working, the weather description isn't.
weather
sub-array is formatted differently in the returned JSON. But I don't know how to get round it.
weather[0].description
?
[0]
in has made it work. Thanks.
ivesnoidea sends brownie points to @mot01 :sparkles: :thumbsup: :sparkles:
:cookie: 521 | @mot01 |http://www.freecodecamp.com/mot01
athabasco sends brownie points to @skycoder01 :sparkles: :thumbsup: :sparkles:
:cookie: 219 | @skycoder01 |http://www.freecodecamp.com/skycoder01
ivesnoidea sends brownie points to @athabasco :sparkles: :thumbsup: :sparkles:
:cookie: 243 | @athabasco |http://www.freecodecamp.com/athabasco
for (var i = data[1].length - 1; i >= 0; i--) {
Math.floor(count / 60 + ":" + count % 60)
You give a string to a maths method. That cannot go well :D This gives you NaN
and nothing will be set in the html
$("#article").empty();
evandcp sends brownie points to @alpox :sparkles: :thumbsup: :sparkles:
:cookie: 778 | @alpox |http://www.freecodecamp.com/alpox
function erything (title, desc, link){
$("#article").empty();
for (var i = data[1].length - 1; i >= 0; i--){
athabasco sends brownie points to @skycoder01 :sparkles: :thumbsup: :sparkles:
:warning: athabasco already gave skycoder01 points
athabasco sends brownie points to @skycoder01 :sparkles: :thumbsup: :sparkles:
:warning: athabasco already gave skycoder01 points
} else
<-- right here must be a {
nav
and not on the ul
. Then you can adjust the position of the ul
inside of the nav
evandcp sends brownie points to @alpox :sparkles: :thumbsup: :sparkles:
:warning: evandcp already gave alpox points
Uncaught ReferenceError: POST is not defined
--> POST
--> "POST"
(Has to be a string)
Cannot read property 'setState' of null
this
is not defined where you use it
console.log
things but not the actual browser errors
this.newQuote.bind(this)
instead of this.newQuote
in the render method
display: flex;
justify-content: center;
.center {
text-align: center;
}
rsxhoxhi sends brownie points to @alpox :sparkles: :thumbsup: :sparkles:
:cookie: 779 | @alpox |http://www.freecodecamp.com/alpox
evandcp sends brownie points to @alpox :sparkles: :thumbsup: :sparkles:
:warning: evandcp already gave alpox points
$("#breakNum")
instead of $("#breakTime")
id="breakNum"
in the html for the element referring to the right number
evandcp sends brownie points to @alpox :sparkles: :thumbsup: :sparkles:
:warning: evandcp already gave alpox points
evandcp sends brownie points to @achudoz :sparkles: :thumbsup: :sparkles:
:cookie: 267 | @achudoz |http://www.freecodecamp.com/achudoz
bitcoinabdi sends brownie points to @pfreema1 :sparkles: :thumbsup: :sparkles:
:cookie: 2 | @pfreema1 |http://www.freecodecamp.com/pfreema1
@bitcoinabdi definitely add
overflow-x: hidden;
to your body {}
margin-left: 600px;
to margin-left: auto;
in the .block
selector.
makeOptimalMove()
.
bitcoinabdi sends brownie points to @alpox and @achudoz :sparkles: :thumbsup: :sparkles:
:cookie: 268 | @achudoz |http://www.freecodecamp.com/achudoz
:cookie: 780 | @alpox |http://www.freecodecamp.com/alpox