position: absolute
on the menu bar, it breaks completely
/* comment */
btn-group-vertical
function mutation(arr) {
var arr0 = arr[0].toLowerCase();
var arr1 = arr[1].toLowerCase();
if (arr0 === arr1){
return true;
} else if(arr0.indexOf(arr1, 0) === arr1.length || arr1.indexOf(arr0, 0) === arr0.length) {
return true;
}
else {
return false;
}
}
mutation(["hello", "Hello"]);
can someone please tell me whats wrong with my code: https://codepen.io/Merryl/pen/JbaYvL?editors=0010
chrome doesnt support getlocation over http and i cant get the api to function over https
amazing stuff really
proxy like crossorigin.me doesnt work either
Firefox is throwing up errors like its gang signs
mutation(["Mary", "Aarmy"])
jdc101214 sends brownie points to @sparklie3 :sparkles: :thumbsup: :sparkles:
:cookie: 319 | @sparklie3 |http://www.freecodecamp.com/sparklie3
function destroyer(arr) {
// Remove all the values
var arr1 = "";
for(var i = 1; i < arr.length; i++){
arr1 = arr.filter(arr[i]);
}
}
destroyer([1, 2, 3, 1, 2, 3], 2, 3);
["Harry Potter",["Harry Potter","Harry Potter (film series)","Harry Potter and the Philosopher's Stone","Harry Potter and the Deathly Hallows","Harry Potter and the Deathly Hallows \u2013 Part 2","Harry Potter and the Half-Blood Prince (film)","Harry Potter and the Philosopher's Stone (film)","Harry Potter and the Deathly Hallows \u2013 Part 1","Harry Potter and the Cursed Child","Harry Potter and the Half-Blood Prince"],["Harry Potter is a series of fantasy novels written by British author J. K. Rowling. The novels chronicle the life of a young wizard, Harry Potter, and his friends Hermione Granger and Ron Weasley, all of whom are students at Hogwarts School of Witchcraft and Wizardry.","Harry Potter is a British-American film series based on the Harry Potter novels by author J. K. Rowling.","Harry Potter and the Philosopher's Stone is the first novel in the Harry Potter series and J. K. Rowling's debut novel, first published in 1997 by Bloomsbury.","Harry Potter and the Deathly Hallows is the seventh and final novel of the Harry Potter series, written by British author J. K.","Harry Potter and the Deathly Hallows \u2013 Part 2 is a 2011 British-American fantasy film directed by David Yates and distributed by Warner Bros.","Harry Potter and the Half-Blood Prince is a 2009 British-American fantasy film directed by David Yates and distributed by Warner Bros.","Harry Potter and the Philosopher's Stone (released in some countries as Harry Potter and the Sorcerer's Stone) is a 2001 British-American fantasy film directed by Chris Columbus and distributed by Warner Bros.","Harry Potter and the Deathly Hallows \u2013 Part 1 is a 2010 British-American fantasy film directed by David Yates and distributed by Warner Bros.","Harry Potter and the Cursed Child is a two-part West End stage play written by Jack Thorne and based on an original new story by Thorne, J.K.","Harry Potter and the Half-Blood Prince is the sixth and penultimate novel in the Harry Potter series, written by British author J. K."],["https://en.wikipedia.org/wiki/Harry_Potter","https://en.wikipedia.org/wiki/Harry_Potter_(film_series)","https://en.wikipedia.org/wiki/Harry_Potter_and_the_Philosopher%27s_Stone","https://en.wikipedia.org/wiki/Harry_Potter_and_the_Deathly_Hallows","https://en.wikipedia.org/wiki/Harry_Potter_and_the_Deathly_Hallows_%E2%80%93_Part_2","https://en.wikipedia.org/wiki/Harry_Potter_and_the_Half-Blood_Prince_(film)","https://en.wikipedia.org/wiki/Harry_Potter_and_the_Philosopher%27s_Stone_(film)","https://en.wikipedia.org/wiki/Harry_Potter_and_the_Deathly_Hallows_%E2%80%93_Part_1","https://en.wikipedia.org/wiki/Harry_Potter_and_the_Cursed_Child","https://en.wikipedia.org/wiki/Harr
[0]
, then there is another array at [1]
, so you are then accessing [1][0]
and it will also say "Harry Potter".
ssgriffen sends brownie points to @khaduch :sparkles: :thumbsup: :sparkles:
:star2: 2119 | @khaduch |http://www.freecodecamp.com/khaduch
please what is the best way to center an unordered list
nicopoore sends brownie points to @mot01 :sparkles: :thumbsup: :sparkles:
:cookie: 396 | @mot01 |http://www.freecodecamp.com/mot01
cocobutter82 sends brownie points to @mot01 :sparkles: :thumbsup: :sparkles:
:cookie: 397 | @mot01 |http://www.freecodecamp.com/mot01
cocobutter82 sends brownie points to @mot01 :sparkles: :thumbsup: :sparkles:
:warning: cocobutter82 already gave mot01 points
function clickThis() {
var searchText = document.getElementById("searchText").value;
var encSearchText = encodeURI(searchText);
var apiLink = "https://crossorigin.me/https://en.wikipedia.org/w/api.php?action=opensearch&search=" + encSearchText +"&limit=10&format=json&callback=res"
//console.log(apiLink);
$.get(apiLink, function res(data) {
//console.log(data);
});
// construct call
// construct output
// display output
}
function openRandom() {
var win = window.open("https://en.wikipedia.org/wiki/Special:Random", '_blank');
win.focus();
}
<a href="https://en.wikipedia.org/wiki/Special:Random" target="_blank">Click here for a random article</a>
:cookie: 269 | @drantho |http://www.freecodecamp.com/drantho
lukaszsobek sends brownie points to @drantho :sparkles: :thumbsup: :sparkles:
drantho sends brownie points to @forkerino :sparkles: :thumbsup: :sparkles:
:cookie: 386 | @forkerino |http://www.freecodecamp.com/forkerino
toccomy sends brownie points to @mr-kumar-abhishek :sparkles: :thumbsup: :sparkles:
:cookie: 450 | @mr-kumar-abhishek |http://www.freecodecamp.com/mr-kumar-abhishek
#nav-wrapper ul li {
display: inline;
background: red;
list-style-type: none;
}
codecampamy sends brownie points to @marianissimus :sparkles: :thumbsup: :sparkles:
:cookie: 215 | @marianissimus |http://www.freecodecamp.com/marianissimus
<div><img id="img" src="#"/>
my html code var iconSRC = "http://openweathermap.org/img/w/" + icon + ".png";
document.getElementById("#img").src("iconSRC");
<!--COST CALCULATOR SECTION START-->
<section class="cost-calculator">
<div class="container-fluid">
<div class="col-md-6">
<div class="left-box">
<div class="text-box">
<h2>Calculate Your Property Cost</h2>
<!--<form action="#" class="row">-->
<div class="col-md-6">
<label>Project</label>
<div class="selector">
<select class="full-width" id="mrunal" onclick="myFunction()">
<option value="la ">La colina</option>
<option value="royal">Royal Casa</option>
<option value="country">Country side</option>
</select><span class="custom-select full-width">La Colina</span>
</div>
</div>
<script>
function myFunction() {
var a=document.getElementById("mrunal").selectedIndex;
switch(a)
{
case 0: document.getElementById("rate").innerHTML = "599";
break;
case 1: document.getElementById("rate").innerHTML = "799";
break;
case 2: document.getElementById("rate").innerHTML = "1000";
break;
}
}
</script>
<div class = "col-md-6">
<label> Out Rate </label>
<label id= "rate" input type = "number"> </label>
</div>
<div class="col-md-6">
<label>sq. ft. required</label>
<input type="number" id= "reqValue">
</div>
<div class="col-md-6">
<label>Total amount</label>
<label id = "total"></label>
</div>
<div class="col-md-12"><button type="button" onclick="calculate()">Calculate</button>
</div>
<script>
function calculate()
{
var a = document.getElementById("rate").value;
var b = document.getElementById("reqValue").value;
var c = a*b;
document.getElementById("total").innerHTML = b;
}
</script>
<!--</form>-->
</div>
</div>
</div>
<!--COST CALCULATOR SECTION END-->
iconSRC
is a variable, removethe "
surrounding it, it should be document.getElementById("#img")attr('src',iconSRC);
diederikquak sends brownie points to @alpox and @oppiniated :sparkles: :thumbsup: :sparkles:
:cookie: 699 | @alpox |http://www.freecodecamp.com/alpox
:cookie: 454 | @oppiniated |http://www.freecodecamp.com/oppiniated
androuino sends brownie points to @sorinr :sparkles: :thumbsup: :sparkles:
:cookie: 955 | @sorinr |http://www.freecodecamp.com/sorinr
<button type="button"> ABOUT </button>
<button type="button"> PORTFOLIO </button>
<button type="button"> CONTACT </button>
These three buttons were created, but these are not aligned in the position I needed
mr-kumar-abhishek sends brownie points to @sorinr :sparkles: :thumbsup: :sparkles:
:cookie: 956 | @sorinr |http://www.freecodecamp.com/sorinr
mr-kumar-abhishek sends brownie points to @alpox :sparkles: :thumbsup: :sparkles:
:cookie: 700 | @alpox |http://www.freecodecamp.com/alpox
well {
min-height: 400px;
}
and you play with 400
anabelsalomone sends brownie points to @callumquick :sparkles: :thumbsup: :sparkles:
:cookie: 298 | @callumquick |http://www.freecodecamp.com/callumquick
anabelsalomone sends brownie points to @sorinr :sparkles: :thumbsup: :sparkles:
:cookie: 957 | @sorinr |http://www.freecodecamp.com/sorinr
davemflick sends brownie points to @amidzicigor :sparkles: :thumbsup: :sparkles:
:cookie: 57 | @amidzicigor |http://www.freecodecamp.com/amidzicigor
nicopoore sends brownie points to @callumquick :sparkles: :thumbsup: :sparkles:
:cookie: 299 | @callumquick |http://www.freecodecamp.com/callumquick
var location;
$.getJSON("api.openweathermap.org/data/2.5/weather?q="+location, function(json){
......
});
:warning: could not find receiver for vengal
mr-kumar-abhishek sends brownie points to @vengal :sparkles: :thumbsup: :sparkles:
#navbar-container
not .navbar-container
and you'll need to apply a color to your navbar to see the button - it is transparent now. Also, do Add bootstrap.css, jquery, and bootstrap.js as @Waqas909 recommends. You can view this pen with a working navbar for comparison: http://codepen.io/TylerMoeller/pen/ozKMRW?editors=1000
:cookie: 276 | @waqas909 |http://www.freecodecamp.com/waqas909
asmaaamer sends brownie points to @waqas909 :sparkles: :thumbsup: :sparkles:
asmaaamer sends brownie points to @tylermoeller :sparkles: :thumbsup: :sparkles:
:star2: 1158 | @tylermoeller |http://www.freecodecamp.com/tylermoeller
waqas909 sends brownie points to @tylermoeller :sparkles: :thumbsup: :sparkles:
:star2: 1159 | @tylermoeller |http://www.freecodecamp.com/tylermoeller
callumquick sends brownie points to @waqas909 :sparkles: :thumbsup: :sparkles:
:cookie: 277 | @waqas909 |http://www.freecodecamp.com/waqas909
markolie20 sends brownie points to @tylermoeller :sparkles: :thumbsup: :sparkles:
:star2: 1160 | @tylermoeller |http://www.freecodecamp.com/tylermoeller
<img src="https://placehold.it/800">
<iframe id="video"
width="100%"
height="100%"
src="https://www.youtube.com/embed/qZKvZzRynLE?enablejsapi=1&controls=0"
frameborder="0"
allowfullscreen
></iframe>
:cookie: 278 | @waqas909 |http://www.freecodecamp.com/waqas909
toccomy sends brownie points to @waqas909 :sparkles: :thumbsup: :sparkles:
<iframe width="560" height="315" src="https://www.youtube.com/embed/RQi-nTcS_Ns" frameborder="0" allowfullscreen></iframe>
neetwizardjanus sends brownie points to @tylermoeller :sparkles: :thumbsup: :sparkles:
:star2: 1161 | @tylermoeller |http://www.freecodecamp.com/tylermoeller
nicopoore sends brownie points to @sorinr :sparkles: :thumbsup: :sparkles:
:cookie: 958 | @sorinr |http://www.freecodecamp.com/sorinr
This Journey is worth it, believe it or not.
Have a look at this video, i found it to be very motivating: https://www.youtube.com/watch?v=pvAsqPbz9Ro
@PankajKaushik78 div class="jumbotron">
<div class="container">
<h1 class="text-center">Dr. Norman Borlaug</h1>
<p class="text-center">The man who saved a billion lives</p>
<div class="thumbnail"><img src="https://static1.squarespace.com/static/5256f6e4e4b086e2b62842e2/t/54bbbd61e4b077c90273b411/1421589862757/?format=1000w"><div class="caption text-center" class="text-center">Dr. Norman Borlaug, second from left, trains biologists in Mexico on how to increase wheat yields - part of his life-long war on hunger.</img></div>
</div>
</div>
<h2 class="text-center">Here's a time line of Dr. Borlaug's life:</h2>
<ul class="text-center" style="list-style-type:disc">
<li><strong>1914 - Born in Cresco, Iowa</li>
<li>1933 - Leaves his family's farm to attend the University of Minnesota, thanks to a Depression era program known as the "National Youth Administration"</li>
<li>1935 - Has to stop school and save up more money. Works in the Civilian Conservation Corps, helping starving Americans. "I saw how food changed them", he said. "All of this left scars on me."
</li>
<li>1937 - Finishes university and takes a job in the US Forestry Service
</li>
<li>
1938 - Marries wife of 69 years Margret Gibson. Gets laid off due to budget cuts. Inspired by Elvin Charles Stakman, he returns to school study under Stakman, who teaches him about breeding pest-resistent plants.
</li>
<li>1941 - Tries to enroll in the military after the Pearl Harbor attack, but is rejected. Instead, the military asked his lab to work on waterproof glue, DDT to control malaria, disenfectants, and other applied science
</li>
<li>
1942 - Receives a Ph.D. in Genetics and Plant Pathology
</li>
<li>1944 - Rejects a 100% salary increase from Dupont, leaves behind his pregnant wife, and flies to Mexico to head a new plant pathology program. Over the next 16 years, his team breeds 6,000 different strains of disease resistent wheat - including different varieties for each major climate on Earth.
</li>
<li>1945 - Discovers a way to grown wheat twice each season, doubling wheat yields
</li>
<li>1953 - crosses a short, sturdy dwarf breed of wheat with a high-yeidling American breed, creating a strain that responds well to fertalizer. It goes on to provide 95% of Mexico's wheat.
</li>
<li>1962 - Visits Delhi and brings his high-yielding strains of wheat to the Indian subcontinent in time to help mitigate mass starvation due to a rapidly expanding population
</li>
<li>1970 - receives the Nobel Peace Prize
</li>
<li>1983 - helps seven African countries dramatically increase their maize and sorghum yields
</li>
<li>1984 - becomes a distinguished professor at Texas A&M University
</li>
<li>2005 - states "we will have to double the world food supply by 2050." Argues that genetically modified crops are the only way we can meet the demand, as we run out of arable land. Says that GM crops are not inherently dangerous because "we've been genetically modifying plants and animals for a long time. Long before we called it science, people were selecting the best breeds."
</li>
<li>2009 - dies at the age of 95.
</li>
<blackquote>
<h3>"Borlaug's life and achievement are testimony to the far-reaching contribution that one man's towering intellect, persistence and scientific vision can make to human peace and progress."</h3> <p><footer>- Indian Prime Minister Manmohan Singh</p></footer>
<h4>If you have time, you should read more about this incredible human being on his <a href="https://en.wikipedia.org/wiki/Norman_Borlaug" target="_blank">Wikipedia entry.</h4> </a> </h4>
</blackquote>
</div>
bobbawoolf sends brownie points to @pankajkaushik78 :sparkles: :thumbsup: :sparkles:
:cookie: 124 | @pankajkaushik78 |http://www.freecodecamp.com/pankajkaushik78
pankajkaushik78 sends brownie points to @tylermoeller :sparkles: :thumbsup: :sparkles:
:star2: 1162 | @tylermoeller |http://www.freecodecamp.com/tylermoeller
#navcss{
margin-left:150px;
}
^^ For example, on a phone that's 250px wide, it will be pushed past the middle of the screen
well if u ever feel down, just remember this
Programmers are wizards of tomorrow - Gabe Newel
pankajkaushik78 sends brownie points to @tylermoeller :sparkles: :thumbsup: :sparkles:
:warning: pankajkaushik78 already gave tylermoeller points
with\*
with*
\
vicfs sends brownie points to @tylermoeller :sparkles: :thumbsup: :sparkles:
:star2: 1163 | @tylermoeller |http://www.freecodecamp.com/tylermoeller
jichoat sends brownie points to @forkerino :sparkles: :thumbsup: :sparkles:
:cookie: 388 | @forkerino |http://www.freecodecamp.com/forkerino
jichoat sends brownie points to @forkerino :sparkles: :thumbsup: :sparkles:
:warning: jichoat already gave forkerino points
<p>
tag, try changing <b class...
<div class="col-xs-3">
You are missing the =
markolie20 sends brownie points to @tylermoeller and @callumquick :sparkles: :thumbsup: :sparkles:
:cookie: 301 | @callumquick |http://www.freecodecamp.com/callumquick
:star2: 1164 | @tylermoeller |http://www.freecodecamp.com/tylermoeller
jichoat sends brownie points to @forkerino :sparkles: :thumbsup: :sparkles:
:warning: jichoat already gave forkerino points
I have a picture working properly on smartphone size screens, but not on regular monitors.
<div class="col-xs-12 col-md-12 center-block">
This my div class that I am using, isn't it suppose to be working?
content-align:center;
jichoat sends brownie points to @callumquick :sparkles: :thumbsup: :sparkles:
:cookie: 302 | @callumquick |http://www.freecodecamp.com/callumquick
jichoat sends brownie points to @bobbawoolf :sparkles: :thumbsup: :sparkles:
:cookie: 120 | @bobbawoolf |http://www.freecodecamp.com/bobbawoolf
align-content: center;
or:margin: 0px auto;
Hey! Any alternatives to
<select name="cars">
for drop down, alternatives which I can style easier with CSS ?
waqas909 sends brownie points to @callumquick :sparkles: :thumbsup: :sparkles:
:cookie: 303 | @callumquick |http://www.freecodecamp.com/callumquick
margin: 0 auto;
, the first number (0) does the top and bottom, the auto does the left and right
col-xs-12
and col-md-12
it basically takes up all the space and so additional centering is probably overkill
jichoat sends brownie points to @callumquick :sparkles: :thumbsup: :sparkles:
:warning: jichoat already gave callumquick points
li{display: inline;}
li{display: inline;}
li
element ... so add a specific class for it ~
li .btn
is working fine. but you need to apply inline to li
and not a
<ul>
as well as the <li>
s within it
littleread sends brownie points to @callumquick :sparkles: :thumbsup: :sparkles:
:cookie: 305 | @callumquick |http://www.freecodecamp.com/callumquick
li .btn
it acts over the tag having .btn
class not the tag above it
.btn
class is a
so it acts over a
li
which is stacked vertically .
inline
should applied to li
and not a
<li class="navlinks"><a href="#"></a></li>
, .navlinks{ display: inline}
<li class="navlinks"><a href="#" class="btn"></a></li>
, .navlinks{ display: inline}
vicfs sends brownie points to @mr-kumar-abhishek :sparkles: :thumbsup: :sparkles:
:cookie: 452 | @mr-kumar-abhishek |http://www.freecodecamp.com/mr-kumar-abhishek
Feeling confused as to why my code is not working. This is for the local weather project. Here is my code for finding current location, weather for that location and then trying to add the data to my webpage. ``` var latitude;
var longitude;
if (navigator.geolocation) {
window.onload = function () {
var currentPosition;
function getCurrentPosition(position) {
currentPosition = position;
latitude = currentPosition.coords.latitude;
longitude = currentPosition.coords.longitude;
}
$.getJSON(" http://api.openweathermap.org/data/2.5/weather?lat=" + latitude + "&lon=" + longitude + "&APPID=0433a45ebc56292fa1c639b6fce3cc63", function(data) {
var rawJson = JSON.stringify(data);
var json = JSON.parse(rawJson);
document.getElementByID("temp").innerHTML = Math.round((json.main.temp) - 273.15);
});
}
navigator.geolocation.getCurrentPosition(getCurrentLocation);
}
```
pilotwhiterabbit sends brownie points to @mr-kumar-abhishek :sparkles: :thumbsup: :sparkles:
:cookie: 453 | @mr-kumar-abhishek |http://www.freecodecamp.com/mr-kumar-abhishek
getCurrentPosition()
, but also getCurrentPosition()
no longer works on insecure origins so you're probably not even getting the latitude and longitude, maybe you should get that info from something like http://ip-api.com/json
emilyaringoen sends brownie points to @callumquick :sparkles: :thumbsup: :sparkles:
:cookie: 306 | @callumquick |http://www.freecodecamp.com/callumquick
$.getJSON("http://ip-api.com/json", function(json) {
//Do something with that JSON file here to get that lat and long
});
<a href="#"></a>
repeterande sends brownie points to @callumquick :sparkles: :thumbsup: :sparkles:
:cookie: 307 | @callumquick |http://www.freecodecamp.com/callumquick
:cookie: 453 | @mr-kumar-abhishek |http://www.freecodecamp.com/mr-kumar-abhishek
tejanth sends brownie points to @callumquick and @bobbawoolf :sparkles: :thumbsup: :sparkles:
:cookie: 308 | @callumquick |http://www.freecodecamp.com/callumquick
:cookie: 121 | @bobbawoolf |http://www.freecodecamp.com/bobbawoolf
:star2: 2746 | @camperbot |http://www.freecodecamp.com/camperbot
.appearr
which makes opacity 1, but you made opacity 0 in an ID selector #menu
... so specificity means that opacity:1
in the class selector can't override the opacity:0
in the ID selector, so it stays as opacity:0
, invisible
twitch
twitch tv
twitch tv api
opacity: 1 !important;
mr-kumar-abhishek sends brownie points to @callumquick :sparkles: :thumbsup: :sparkles:
:cookie: 309 | @callumquick |http://www.freecodecamp.com/callumquick
waqas909 sends brownie points to @mot01 and @callumquick :sparkles: :thumbsup: :sparkles:
:cookie: 414 | @mot01 |http://www.freecodecamp.com/mot01
:cookie: 310 | @callumquick |http://www.freecodecamp.com/callumquick
waqas909 sends brownie points to @callumquick :sparkles: :thumbsup: :sparkles:
:warning: waqas909 already gave callumquick points
jspadgett82 sends brownie points to @callumquick :sparkles: :thumbsup: :sparkles:
:cookie: 311 | @callumquick |http://www.freecodecamp.com/callumquick
@callumquick That ‘complete’ one was using http://api.openweathermap.org/data/2.5/weather?lat=39.6858&lon=-86.4106&appid=40f59e6113fb2dc24936838e8d72288a
I’m redoing it with a different codepen page with the five day api, but using data.list[0-4].whatever.whatever is giving me issues. Is there a reason to use json.stuff.stuff instead? It worked with data before.
@MoJoe13 Set your div height and width to 100% and then set your background image size to 100%
~~~
background-size: 100% 100%;
var country = data.list[0].temp.day;
seems to me the "data" it has is only location based, not the weather data
waqas909 sends brownie points to @callumquick :sparkles: :thumbsup: :sparkles:
:warning: waqas909 already gave callumquick points
@emilyaringoen
$(document).ready(function() {
var lat, lon, units;
$.get('', function(data) {
$("#data").text(data);
});
});
This is the function getting the data yes? But it's not getting it from anywhere because in $.get()
your first argument is ""
i.e. nothing :) Make it $.get("http://ip-api.com/json", function...
and that should work
@callumquick In my one day api…
var ltemp = data.main.temp;
was getting me the data from the api and working for what I needed. That’s what I was going off of so I could use that.
var country = data.list[0].temp.day;
Is just placeholder for me to test and use the variable name to edit .html so I can see I’m drawing it from the api correctly.
var country
you see
emilyaringoen sends brownie points to @callumquick :sparkles: :thumbsup: :sparkles:
:warning: emilyaringoen already gave callumquick points
mojoe13 sends brownie points to @waqas909 :sparkles: :thumbsup: :sparkles:
:cookie: 279 | @waqas909 |http://www.freecodecamp.com/waqas909