var searchterm = "";
var api = "https://en.wikipedia.org/w/api.php?format=json&action=query&generator=search&gsrnamespace=0&gsrlimit=10&prop=extracts&exintro&explaintext&exsentences=1&exlimit=max&gsrsearch=";
var pageID;
var title;
var extract;
var testjson;
var queryurl = "http://en.wikipedia.org/?curid=";
var html = "";
var pagekeys;
$('.myform').on('submit', function(ev)
{
if(ev){ev.preventDefault();}
//html="";
$('#result').html('hello');
searchterm = $("#searchterm").val();
console.log(searchterm);
$.ajax({
url: api + searchterm,
type: "get",
dataType: "JSONP",
success: function(data) {
testjson = data;
var results = data.query.pages;
pagekeys = Object.keys(results);
//console.log(results);
pagekeys.forEach(myfunc);
$("#result").html('hello');
}
});
});
function myfunc(page) {
pageID = page;
title = testjson.query.pages[page].title;
extract = testjson.query.pages[page].extract;
html += '<div class="result"><a href="' + queryurl + pageID + '" target="_blank" class="result"> <h4>' + title + '</h4><h2>' + extract + '</h2></a></div>'
console.log(extract);
};
class="col-xs-12 col-sm-10 col-sm-offset-1 col-md-8 col-md-offset-2"
.container{width:800px; margin:0 auto;}
and it will center the content, then remove the width:80%
from row
.row{line-height:100px;}
dctor sends brownie points to @bscyrpt :sparkles: :thumbsup: :sparkles:
:cookie: 284 | @bscyrpt |http://www.freecodecamp.com/bscyrpt
function myReplace(str, before, after) {
var ifUpper = '';
if (before[0] == before.toUpperCase()){
ifUpper = after[0].stringToUpper();
}
var initialArray = str.split(" ");
var start = initialArray.indexOf(before);
var removed = initialArray.splice(start, 1, ifUpper || after);
var newArray = initialArray.join(" ");
return newArray;
}
myReplace("Let us get back to more Coding", "Coding", "algorithms");
if (before[0] == before.toUpperCase()){
is comparing the first letter to the entire string (after uppercasing it) - if you just did the first letter of the before.toUpperCase()
, maybe that would work?
dctor sends brownie points to @bscyrpt :sparkles: :thumbsup: :sparkles:
:warning: dctor already gave bscyrpt points
function myReplace(str, before, after) {
var start, initialArray, removed, newArray;
if (before[0] === before[0].toUpperCase()){
initialArray = str.split(" ");
start = initialArray.indexOf(before);
removed = initialArray.splice(start, 1, after[0].toUpperCase() + after.substr(1));
newArray = initialArray.join(" ");
return newArray;
}else{
initialArray = str.split(" ");
start = initialArray.indexOf(before);
removed = initialArray.splice(start, 1, after);
newArray = initialArray.join(" ");
return newArray;
}
}
myReplace("Let us get back to more Coding", "Coding", "algorithms");
if (someRegex === afterword){
do the replace wtih str to upper
}else{
just str.replace(before,after)
}
String.replace()
Write an algorithm that will take an array
for the first argument and return an array
with all the object
s that matches all the properties and values in the Object
passed as second parameter.
:pencil: read more about algorithm where art thou on the FCC Wiki
dear all I need help with my project. I'm trying to animate the yellow border to exten on load. please kindly assist.
$(document).ready(function() {})
nqdai1992 sends brownie points to @juwdohr :sparkles: :thumbsup: :sparkles:
:cookie: 336 | @juwdohr |http://www.freecodecamp.com/juwdohr
hi, could someone possibly tell me why this is returning false?
function palindrome(str) {
return str === str.split('').reverse().join('');
}
palindrome("never odd or even");
$.getJSON(url, function(){});
js
num=5. for (i=0;i<num;i++){arr.push(num[i])
Hello guys !
I dont know why my last green button does not target on the youtube link, please
<a href="https://www.youtube.com/watch?v=BH0BNbwqNK8" target="_blank">Back to the Future 25th Anniversary's Trailer</a>
<a ... > </a>
) within the <button> tags.<button class="btn btn-success btn-block"><a href="https://www.youtube.com/watch?v=BH0BNbwqNK8" target="_blank">Back to the Future 25th Anniversary's Trailer</a></button>
I'm looking at them. They're anchor tags too, and they work fine.
Back to the problem, have you actually clicked the text inside the button that says :" Back to the Future 25th Anniversary's Trailer" ?
What I think is happening is that Bootstrap has drawn the shape of a button, but isn't acting like one because the code that acts as the hyperlink isn't actually the button.
It is inside the button.
robson-beaudry sends brownie points to @benmhz :sparkles: :thumbsup: :sparkles:
:cookie: 250 | @benmhz |http://www.freecodecamp.com/benmhz
if(cells.length === 0 && $('#myModal3').data('bs.modal') ){
$('#showResult').html('this game is tight');
$('#myModal3').modal('show');
}
function sumFibs(num) {
var count=0;
var arr=[];
var digit=1;
while(!digit+digit %2===0&& digit<num){
count+=digit;
}
return count;
}
sumFibs(4);
Im trying to find and add all the odd fib numbers of num... My FCC has been crashing a lot tho so just checking whats going on here to only return 0 when I run it?
{
"latitude": 37.8716,
"longitude": -122.2728,
"timezone": "America/Los_Angeles",
"offset": -7,
"currently": {
"time": 1465452267,
"summary": "Mostly Cloudy",
"icon": "partly-cloudy-night",
"nearestStormDistance": 16,
"nearestStormBearing": 78,
"precipIntensity": 0,
"precipProbability": 0,
"temperature": 56.16,
"apparentTemperature": 56.16,
"dewPoint": 52.83,
"humidity": 0.89,
"windSpeed": 5.94,
"windBearing": 250,
"visibility": 6.07,
"cloudCover": 0.82,
"pressure": 1013.2,
"ozone": 326.06
},
"minutely": {
"summary": "Mostly cloudy for the hour.",
"icon": "partly-cloudy-night",
"data": [{
"time": 1465452240,
"precipIntensity": 0,
"precipProbability": 0
}, {
"time": 1465452300,
"precipIntensity": 0,
"precipProbability": 0
}, {
"time": 1465452360,
"precipIntensity": 0,
"precipProbability": 0
}, {
"time": 1465452420,
"precipIntensity": 0,
"precipProbability": 0
}, {
"time": 1465452480,
"precipIntensity": 0,
"precipProbability": 0
}, {
"time": 1465452540,
"precipIntensity": 0,
"precipProbability": 0
}, {
"time": 1465452600,
"precipIntensity": 0,
"precipProbability": 0
}, {
"time": 1465452660,
"precipIntensity": 0,
"precipProbability": 0
}, {
"time": 1465452720,
"precipIntensity": 0,
"precipProbability": 0
}, {
"time": 1465452780,
"precipIntensity": 0,
"precipProbability": 0
}, {
"time": 1465452840,
"precipIntensity": 0,
"precipProbability": 0
}, {
"time": 1465452900,
"precipIntensity": 0,
"precipProbability": 0
}, {
"time": 1465452960,
"precipIntensity": 0,
"precipProbability": 0
}, {
"time": 1465453020,
"precipIntensity": 0,
"precipProbability": 0
}, {
"time": 1465453080,
"precipIntensity": 0,
"precipProbability": 0
}, {
"time": 1465453140,
"precipIntensity": 0,
"precipProbability": 0
}, {
"time": 1465453200,
"precipIntensity": 0,
"precipProbability": 0
}, {
"time": 1465453260,
"precipIntensity": 0,
"precipProbability": 0
}, {
"time": 1465453320,
"precipIntensity": 0,
"precipProbability": 0
}, {
"time": 1465453380,
"precipIntensity": 0,
"precipProbability": 0
}, {
"time": 1465453440,
"precipIntensity": 0,
"precipProbability": 0
}, {
"time": 1465453500,
"precipIntensity": 0,
"precipProbability": 0
}, {
"time": 1465453560,
"precipIntensity": 0,
"precipProbability": 0
}, {
"time": 1465453620,
"precipIntensity": 0,
"precipProbability": 0
}, {
"time": 1465453680,
"precipIntensity": 0,
"precipProbability": 0
}, {
"time": 1465453740,
"precipIntensity": 0,
"precipProbability": 0
}, {
"time": 1465453800,
"precipIntensity": 0,
"precipProbability": 0
}, {
"time": 1465453860,
"precipIntensity": 0,
"precipProbability": 0
}, {
"time": 1465453920,
"precipIntensity": 0,
"precipProbability": 0
}, {
"time": 1465453980,
"precipIntensity": 0,
"precipProbability": 0
}, {
"time": 1465454040,
"precipIntensity": 0,
"precipProbability": 0
}, {
"time": 1465454100,
"precipIntensity": 0,
"precipProbability": 0
}, {
"time": 1465454160,
"precipIntensity": 0,
"precipProbability": 0
}, {
"time": 1465454220,
"precipIntensity": 0,
"precipProbability": 0
}, {
"time": 1465454280,
"precipIntensity": 0,
"precipProbability": 0
}, {
"time": 1465454340,
"precipIntensity": 0,
"precipProbability": 0
}, {
"time": 1465454400,
"precipIntensity": 0,
"precipProbability": 0
}, {
"time": 1465454460,
"precipIntensity": 0,
"precipProbability": 0
}, {
"time": 1465454520,
"precipIntensity": 0,
"precipProbability": 0
}, {
"time": 1465454580,
"precipIntensity": 0,
"precipProbability": 0
}, {
"time": 1465
function sumFibs(num) {
var count=0;
var arr=[];
var digit=1;
while(digit<num){
//while dig is less than num
digit= digit+ digit;
//digit = 1 + prev digit
if(digit+digit %2!==0){
arr.push(digit);
}}
return arr;
}
sumFibs(5);
THis is giving me only even numbers on digit!??
{
"latitude": 37.8716,
"longitude": -122.2728,
"timezone": "America/Los_Angeles",
"offset": -7,
"currently": {
"time": 1465453515,
"summary": "Mostly Cloudy",
"icon": "partly-cloudy-night",
"nearestStormDistance": 19,
"nearestStormBearing": 48,
"precipIntensity": 0,
"precipProbability": 0,
"temperature": 56.36,
"apparentTemperature": 56.36,
"dewPoint": 52.71,
"humidity": 0.88,
"windSpeed": 6.38,
"windBearing": 250,
"visibility": 5.61,
"cloudCover": 0.81,
"pressure": 1013.21,
"ozone": 327.08
},
"minutely": {
"summary": "Mostly cloudy for the hour.",
"icon": "partly-cloudy-night",
"data": [{
"time": 1465453500,
"precipIntensity": 0,
"precipProbability": 0
}, {
"time": 1465453560,
"precipIntensity": 0,
"precipProbability": 0
}, {
"time": 1465453620,
"precipIntensity": 0,
"precipProbability": 0
}, {
"time": 1465453680,
"precipIntensity": 0,
"precipProbability": 0
}, {
"time": 1465453740,
"precipIntensity": 0,
"precipProbability": 0
}, {
"time": 1465453800,
"precipIntensity": 0,
"precipProbability": 0
}, {
"time": 1465453860,
"precipIntensity": 0,
"precipProbability": 0
}, {
"time": 1465453920,
"precipIntensity": 0,
"precipProbability": 0
}, {
"time": 1465453980,
"precipIntensity": 0,
"precipProbability": 0
}, {
"time": 1465454040,
"precipIntensity": 0,
"precipProbability": 0
}, {
"time": 1465454100,
"precipIntensity": 0,
"precipProbability": 0
}, {
"time": 1465454160,
"precipIntensity": 0,
"precipProbability": 0
}, {
"time": 1465454220,
"precipIntensity": 0,
"precipProbability": 0
}, {
"time": 1465454280,
"precipIntensity": 0,
"precipProbability": 0
}, {
"time": 1465454340,
"precipIntensity": 0,
"precipProbability": 0
}, {
"time": 1465454400,
"precipIntensity": 0,
"precipProbability": 0
}, {
"time": 1465454460,
"precipIntensity": 0,
"precipProbability": 0
}, {
"time": 1465454520,
"precipIntensity": 0,
"precipProbability": 0
}, {
"time": 1465454580,
"precipIntensity": 0,
"precipProbability": 0
}, {
"time": 1465454640,
"precipIntensity": 0,
"precipProbability": 0
}, {
"time": 1465454700,
"precipIntensity": 0,
"precipProbability": 0
}, {
"time": 1465454760,
"precipIntensity": 0,
"precipProbability": 0
}, {
"time": 1465454820,
"precipIntensity": 0,
"precipProbability": 0
}, {
"time": 1465454880,
"precipIntensity": 0,
"precipProbability": 0
}, {
"time": 1465454940,
"precipIntensity": 0,
"precipProbability": 0
}, {
"time": 1465455000,
"precipIntensity": 0,
"precipProbability": 0
}, {
"time": 1465455060,
"precipIntensity": 0,
"precipProbability": 0
}, {
"time": 1465455120,
"precipIntensity": 0,
"precipProbability": 0
}, {
"time": 1465455180,
"precipIntensity": 0,
"precipProbability": 0
}, {
"time": 1465455240,
"precipIntensity": 0,
"precipProbability": 0
}, {
"time": 1465455300,
"precipIntensity": 0,
"precipProbability": 0
}, {
"time": 1465455360,
"precipIntensity": 0,
"precipProbability": 0
}, {
"time": 1465455420,
"precipIntensity": 0,
"precipProbability": 0
}, {
"time": 1465455480,
"precipIntensity": 0,
"precipProbability": 0
}, {
"time": 1465455540,
"precipIntensity": 0,
"precipProbability": 0
}, {
"time": 1465455600,
"precipIntensity": 0,
"precipProbability": 0
}, {
"time": 1465455660,
"precipIntensity": 0,
"precipProbability": 0
}, {
"time": 1465455720,
"precipIntensity": 0,
"precipProbability": 0
}, {
"time": 1465455780,
"precipIntensity": 0,
"precipProbability": 0
}, {
"time": 1465455840,
"precipIntensity": 0,
"precipProbability": 0
}, {
"time": 146
can someone answer this for me?
if I have an h1, h4 and a UL with three Li elements all inside a div with the class "nav"... is there any reason why calling
.nav {
display: inline;
}
does not display the elements inline, but when i call
h1, h4, ul, li {
display: inline;
}
it does? shouldnt the style be applied to all within the class?
ericbezanson sends brownie points to @sorinr :sparkles: :thumbsup: :sparkles:
:cookie: 344 | @sorinr |http://www.freecodecamp.com/sorinr
mindfluid sends brownie points to @ericbezanson :sparkles: :thumbsup: :sparkles:
:cookie: 142 | @ericbezanson |http://www.freecodecamp.com/ericbezanson
mindfluid sends brownie points to @sorinr and @sannek :sparkles: :thumbsup: :sparkles:
:cookie: 421 | @sannek |http://www.freecodecamp.com/sannek
:cookie: 345 | @sorinr |http://www.freecodecamp.com/sorinr
var collection = {
2548: {
album: "Slippery When Wet",
artist: "Bon Jovi",
tracks: [
"Let It Rock",
"You Give Love a Bad Name"
]
},
2468: {
album: "1999",
artist: "Prince",
tracks: [
"1999",
"Little Red Corvette"
]
},
1245: {
artist: "Robert Palmer",
tracks: [ ]
},
5439: {
album: "ABBA Gold"
}
};
// Keep a copy of the collection for tests
var collectionCopy = JSON.parse(JSON.stringify(collection));
// Only change code below this line
function updateRecords(id, prop, value) {
if (prop === "tracks" && value !== "") {
if(collection[id].hasOwnProperty(prop))
collection[id][prop].push(value);
else
collection[id][prop]=[value];
collection[id][prop].push(value);
collection[id][prop]=[value];
} else if (value === "") {
delete collection[id][prop];
}
return collection;
}
// Alter values below to test your code
updateRecords(5439, "artist", "ABBA");
mar10-9us sends brownie points to @holic101 :sparkles: :thumbsup: :sparkles:
:cookie: 335 | @holic101 |http://www.freecodecamp.com/holic101
Hello everyone. Help me to find a error:
str = '10';
parseInt(str);
console.log(str);
typeof str;
it returns type string
why doesn't it convert str to number format?
$("button").click(function(){
$.getJSON("demo_ajax_json.js", function(result){
$.each(result, function(i, field){
$("div").append(field + " ");
});
});
});
Hey there. I'm working on a more professional looking portfolio page, but I've come up on something I don't know how to do and am having trouble googling: https://preview.c9users.io/chadkreutzer/portfolio/index.html?_c9_id=livepreview0&_c9_host=https://ide.c9.io
What I want to do, is for each section, I want to have the background stay the same as you scroll the associated content and then once the content for that section is done, it will scroll to the next background.
$(document).ready(function () {
$.getJSON('example.json', function (data) {
console.log(data);
});
musedivision sends brownie points to @kirbyedy and @sorinr :sparkles: :thumbsup: :sparkles:
:cookie: 346 | @sorinr |http://www.freecodecamp.com/sorinr
:star2: 1086 | @kirbyedy |http://www.freecodecamp.com/kirbyedy
forEach function not working properly, why?
var date1 = ["2016", "07", "01"];
date1.forEach(function(elem){
elem = parseInt(elem);
});
everything's fine, except it doesn't convert to the number format
nqdai1992 sends brownie points to @kirbyedy :sparkles: :thumbsup: :sparkles:
:star2: 1087 | @kirbyedy |http://www.freecodecamp.com/kirbyedy
var date1 = ["2016", "07", "01"]
// Map
var dateNum = date1.map(function(elem){
return parseInt(elem)
});
// ForEach
var dateNum2 = []
date1.forEach(function(elem){
dateNum2.push(parseInt(elem))
})
console.log(dateNum2)
console.log(dateNum2)
console.log(date1.map(function(elem){return parseInt(elem)})
would be perfectly valid. but you couldn't do the same thing with date1.forEach
from the MDN:
forEach() executes the callback function once for each array element; unlike map() or reduce() it always returns the value undefined and is not chainable. The typical use case is to execute side effects at the end of a chain.
the classic
for (var i = 0; i < date1.length; i++) {
date1[i] = parseInt(date1[i]);
}
is the best as usual)
date1.map(function(elem){return parseInt(elem)})
is pretty simple.
date1 = date1.map(function(str){
return parseInt(str);
});
yes it is
y-taras sends brownie points to @chadkreutzer :sparkles: :thumbsup: :sparkles:
:cookie: 603 | @chadkreutzer |http://www.freecodecamp.com/chadkreutzer
@Y-Taras no prob. here:
var date1 = ["2016", "07", "01"]
console.log(dateToInt(date1))
function dateToInt(arr) {
return date1.map(function(elem) {
return parseInt(elem)
})
}
as an example.
var url = 'https://api.twitch.tv/kraken/streams/' + allChannels[i];
then do you ajax call with this as the url param
/**
* Created by uday on 6/8/16.
*/
(function () {
"use strict";
var todoApp = angular.module('todoApp', ['ngMaterial']);
todoApp.controller('todoController', function ($scope) {
var self = $scope;
self.todoArray = ["Hello"];
var listId = 0;
self.addTodo = function () {
self.todoArray.push(self.todoTitle);
self.drawList();
};
self.drawList = function () {
var html = '<div class="todo-list-layout" ng-controller="todoController"><input type="checkbox" class="todo-checkbox">' +
'<label class="todo-title">' + self.todoArray[self.todoArray.length - 1] + '</label>' +
'<button id="list-id-' + listId + '" class="todo-cancel" onclick="removeTodo()">X</button></div>';
document.getElementById('todo-list').innerHTML += html;
listId++;
};
self.removeTodo =function () {
console.log("clicked");
};
});
})();
in var html button click function not working please provide any hint for how its work in angular
hi guys, i build tic tac toe
http://codepen.io/buiphuking/pen/JKoEZG?editors=0010
if(cells.length === 0 && $('#myModal3').data('bs.modal') ){
$('#showResult').html('this game is tight');
$('#myModal3').modal('show');
}
why this code won't work
onScrollStart
and onScrollEnd
events makes it really hard to get work
@Whiplash5057 something like
function callAPI(url, channel, callback,errorCallback)
{
$.getJSON(url+channel).done(callback).fail(errorCallback);
}
so you can just use it as much as you want without retyping $.getJSON
whiplash5057 sends brownie points to @sorinr :sparkles: :thumbsup: :sparkles:
:cookie: 347 | @sorinr |http://www.freecodecamp.com/sorinr
@Nachlawi use this url
var url = "https://en.wikipedia.org/w/api.php?format=json&action=query&generator=search&gsrnamespace=0&gsrlimit=10&prop=pageimages|extracts&pilimit=max&exintro&explaintext&exsentences=1&exlimit=max&gsrsearch=" + topic + "&callback=?";
adding "&callback=?" make the format jsonp to buypass crossorigin error
nachlawi sends brownie points to @wearenotgroot :sparkles: :thumbsup: :sparkles:
:star2: 1112 | @wearenotgroot |http://www.freecodecamp.com/wearenotgroot
legyolo sends brownie points to @sorinr :sparkles: :thumbsup: :sparkles:
:cookie: 351 | @sorinr |http://www.freecodecamp.com/sorinr
img {
display: block;
margin-left: auto;
margin-right: auto }
legyolo sends brownie points to @gregatgit :sparkles: :thumbsup: :sparkles:
:cookie: 571 | @gregatgit |http://www.freecodecamp.com/gregatgit
ketchypie sends brownie points to @sorinr :sparkles: :thumbsup: :sparkles:
:cookie: 352 | @sorinr |http://www.freecodecamp.com/sorinr
<h1>Jack Reinke</h1>
<div class="row">
<div class="col-md-9"></div>
<div class="col-md-3">
<button class="btn">About</button>
<button class="btn">Portfolio</button>
<button class="btn">Contact Us</button>
</div>
</div>
@ctataru
i build tic tac toe too,
if(cells.length === 0 && $('#myModal3').data('bs.modal') ){
$('#showResult').html('this game is tight');
$('#myModal3').modal('show');
}
this line won't work
http://codepen.io/buiphuking/pen/JKoEZG?editors=0010
vinay-jaju sends brownie points to @sorinr :sparkles: :thumbsup: :sparkles:
:cookie: 353 | @sorinr |http://www.freecodecamp.com/sorinr
:cookie: 371 | @cameron-burkholder |http://www.freecodecamp.com/cameron-burkholder
marcusk71 sends brownie points to @cameron-burkholder :sparkles: :thumbsup: :sparkles:
$('.btn').click(function (){
$.getJSON("http://api.forismatic.com/api/1.0/?method=getQuote&lang=en&format=jsonp&jsonp=?", function(json){
//take the quote and put it into a div
});
});
cameron-burkholder sends brownie points to @vinay-jaju :sparkles: :thumbsup: :sparkles:
:cookie: 283 | @vinay-jaju |http://www.freecodecamp.com/vinay-jaju
checkWin()
here only be truthy if it returns something?if (checkWin()) {
checkWin();
gameOver = true;
}
gerarddawson sends brownie points to @vinay-jaju :sparkles: :thumbsup: :sparkles:
:cookie: 284 | @vinay-jaju |http://www.freecodecamp.com/vinay-jaju
$('.btn').click(function (){
$.getJSON("http://api.forismatic.com/api/1.0/?method=getQuote&lang=en&format=jsonp&jsonp=?", function(json){
console.log('json');
});
});
console.log(json)
checkWin()
returns something, right?if (checkWin()) {
checkWin();
gameOver = true;
}
My main goal for the Weather App is functionality over design, so excuse the bad css and stuff. However, I called the API and I think that I have to call a function that uses it somehow, but I am not sure what to do from there.
$("document").ready(main);
var long;
var latt;
var tempF;
var tempC;
var c = true;
var time = moment().format('h:mm A');
var day = moment().format('dddd, MMM D');
function main() {
navigator.geolocation.getCurrentPosition();
latt = coords.latitude;
long = coords.longitude;
$("#place").html(latt);
$("#place").text(long);
$("#degrees").click(function() {
if (c) {
celcius2();
} else {
f2();
}
});
$.getJSON("api.openweathermap.org/data/2.5/forecast/city?id=524901&APPID=a3b3fd3219c48bb3e1c601a38dfa859d", function(json) {
});
$("#time").text(time);
$("#date").text(day);
}
function celcius2() {
$("#degrees").html("Fahrenheit");
c = false;
}
function f2() {
$("#degrees").html("Centigrade");
c = true;
}
$('.btn').click(function (){
$.getJSON("http://api.forismatic.com/api/1.0/?method=getQuote&lang=en&format=jsonp&jsonp=?", function( data ){
console.log( data.quoteText );console.log( data.quoteAuthor );
});
});
background-color: white;
margin-top: 0px;
width: 1024px;
Hey guys i'm trying out bootstrap and i want to make my navbar occupy the container but i just can't get around as to how i should do that. Like, i want instead of having ever <li> element aligned to the left, i want it evenly spread-out -- how do i do it with bootstrap? btw code is a bit messy atm i only use codepen to get the code out there
lahowitt sends brownie points to @bscyrpt :sparkles: :thumbsup: :sparkles:
:cookie: 285 | @bscyrpt |http://www.freecodecamp.com/bscyrpt
:cookie: 243 | @gerarddawson |http://www.freecodecamp.com/gerarddawson
katgeek sends brownie points to @gerarddawson :sparkles: :thumbsup: :sparkles:
tjasak sends brownie points to @belax8 and @utkarshshukla7 :sparkles: :thumbsup: :sparkles:
:cookie: 397 | @belax8 |http://www.freecodecamp.com/belax8
:cookie: 599 | @utkarshshukla7 |http://www.freecodecamp.com/utkarshshukla7
col-md-*
to col-xs-*
tjasak sends brownie points to @utkarshshukla7 :sparkles: :thumbsup: :sparkles:
:warning: tjasak already gave utkarshshukla7 points
// Extra small screen / phone
xs: 0,
// Small screen / phone
sm: 544px,
// Medium screen / tablet
md: 768px,
// Large screen / desktop
lg: 992px,
// Extra large screen / wide desktop
xl: 1200px
isaacgg sends brownie points to @wearenotgroot :sparkles: :thumbsup: :sparkles:
:star2: 1114 | @wearenotgroot |http://www.freecodecamp.com/wearenotgroot
function assignCoords(position) {
long = position.coords.longitude;
latt = position.coords.latitude;
$("#place").html(latt);
// $("#place").text(long);
}
@Cameron-Burkholder
if(navigator.geolocation){
navigator.geolocation.getCurrentPosition(function(position){
latitude = position.coords.latitude;
longitude = position.coords.longitude;
console.log(latitude); //works
});
}
console.log("Latitude: " + latitude); //doesn't work
// Like This
function changeQuote(){
var title, content;
$.getJSON("http://quotesondesign.com/wp-json/posts?filter[orderby]=rand&filter[posts_per_page]=1&callback=", function(val) {
title = val[0].title;
content = val[0].content;
$("#quote").html(title);
$("#quote_by").html(content);
// Or use a callback
showQuote(val);
});
};
// The callback
function showQuote(quote) {
console.log(quote[0].content);
}
$(document).ready(function(){
//var latitude, longitude;
if(navigator.geolocation){
navigator.geolocation.getCurrentPosition(function(position){
//Get latitude, longitude, and set weatherAPI URL
var lat = position.coords.latitude;
var long = position.coords.longitude;
var weatherAPI = "http://api.openweathermap.org/data/2.5/weather?lat=" + lat + "&lon=" + long + "&APPID=83a973fe5216202f34e2c142a70d008f";
//Get JSON data from openweathermap
$.getJSON(weatherAPI, function(json){
$("#data").html(JSON.stringify(json));
});
});
}
function changeQuote(){
var title, content; // These are scoped to this function and can't be accessed outside unless you return or send them
$.getJSON("http://quotesondesign.com/wp-json/posts?filter[orderby]=rand&filter[posts_per_page]=1&callback=", function(val) {
showQuote(val);
console.log("hola");
title = val[0].title;
content = val[0].content;
});
// This won't work
console.log("algo");
console.log(title);
$("#quote").html(title);
$("#quote_by").html(content);
};
// This does work because you got the info from the api call and then sent it to this function
function showQuote(val){
console.log(val[0].content);
}
jkilgore07 sends brownie points to @dhcodes :sparkles: :thumbsup: :sparkles:
:cookie: 983 | @dhcodes |http://www.freecodecamp.com/dhcodes
cameron-burkholder sends brownie points to @grizvok :sparkles: :thumbsup: :sparkles:
:cookie: 168 | @grizvok |http://www.freecodecamp.com/grizvok
isaacgg sends brownie points to @jdtdesigns and @dhcodes :sparkles: :thumbsup: :sparkles:
:cookie: 985 | @dhcodes |http://www.freecodecamp.com/dhcodes
:cookie: 453 | @jdtdesigns |http://www.freecodecamp.com/jdtdesigns
var url = 'http://ip-api.com/json`;
$.getJSON(url, function(json){
console.log(JSON.stringify(json));
// update your lat and long from the json
// do your weather api call here with updated lat and long
});
ethanhitgub sends brownie points to @needsmorecoffee :sparkles: :thumbsup: :sparkles:
:cookie: 311 | @needsmorecoffee |http://www.freecodecamp.com/needsmorecoffee
Hey can someone tell me why the this image and text are not aligning properly, they should appear next to eachother horizontally not vertically should they not? (its bootstrap)
<div class="row">
<div id="about"></div>
<div class="col-md-6">
<img class="img-responsive" id="portrait" src="http://placehold.it/350x350">
</div>
<div class="col-md-6" id="bio">
<p>Hey my name is Eric, Currently I am a Web Developer in training! This is on of my first projects and I hope you enjoy it. My contact info is listed above feel free to contact me by any means!</p>
</div>
</div>
ericbezanson sends brownie points to @gregatgit :sparkles: :thumbsup: :sparkles:
:cookie: 572 | @gregatgit |http://www.freecodecamp.com/gregatgit