XMLHttpRequest cannot load https://en.wikipedia.org/w/api.php?action=query&format=json&prop=links&list=search&srsearch=will+smith&srwhat=text. Response to preflight request doesn't pass access control check: No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'http://s.codepen.io' is therefore not allowed access.
am3ricanpaladin sends brownie points to @smzagury :sparkles: :thumbsup: :sparkles:
:star: 286 | @smzagury | http://www.freecodecamp.com/smzagury
dueldrawer8 sends brownie points to @juliankrispel :sparkles: :thumbsup: :sparkles:
:warning: could not find receiver for juliankrispel
<p data-height="268" data-theme-id="0" data-slug-hash="MyQjXY" data-default-tab="result" data-user="thatssojessy" class="codepen">See the Pen <a href="https://codepen.io/thatssojessy/pen/MyQjXY/">Phife Dawg Tribute Page</a> by Jessica Dembe (<a href="http://codepen.io/thatssojessy">@thatssojessy</a>) on <a href="http://codepen.io">CodePen</a>.</p>
<script async src="//assets.codepen.io/assets/embed/ei.js"></script>
papaunik1993 sends brownie points to @gregory-buhler :sparkles: :thumbsup: :sparkles:
:star: 315 | @gregory-buhler | http://www.freecodecamp.com/gregory-buhler
dataType: 'jsonp'
and that does the trick
sorry dueldrawer8, you can't send brownie points to yourself! :sparkles: :sparkles:
dueldrawer8 sends brownie points to @juliankrispel :sparkles: :thumbsup: :sparkles:
:warning: could not find receiver for juliankrispel
jessica-dembe sends brownie points to @sirseanconnerie :sparkles: :thumbsup: :sparkles:
:star: 276 | @sirseanconnerie | http://www.freecodecamp.com/sirseanconnerie
dataType
not datatype
body{
height: 1200px;
}
<script>
var scrolled = -51;
$(document).ready(function(){
$(".navi li a").on("click" ,function(obj){
var id = $(this).attr("id");
id = id.split("_");
id = id[0];
$('html, body').animate({
scrollTop: $("#" + id).offset().top + scrolled
}, 1200);
});
});
</script>
rohitrawat2000 sends brownie points to @sjames1958gm :sparkles: :thumbsup: :sparkles:
:star: 571 | @sjames1958gm | http://www.freecodecamp.com/sjames1958gm
dardandemiri sends brownie points to @am3ricanpaladin :sparkles: :thumbsup: :sparkles:
:star: 67 | @am3ricanpaladin | http://www.freecodecamp.com/am3ricanpaladin
am3ricanpaladin sends brownie points to @dardandemiri :sparkles: :thumbsup: :sparkles:
:star: 285 | @dardandemiri | http://www.freecodecamp.com/dardandemiri
$(document).ready(function(){
$(".navi li a").on("click" ,function(obj){ // your menu
var id = $(this).attr("id");
id = id.split("_");
id = id[0];
$('html, body').animate({
scrollTop: $("#" + id).offset().top
}, 1200);
});
});
the menu List should be like this:
```
<li class="selected"><a id="About_n" href="javascript:void(0);">ABOUT</a></li>
What i have done is this:
I made first just the layout of the page in a paper.
Than I coded it on HTML and CSS.
And that's it.
After going throw other lessons, I learned javascript and started adding effects on site
am3ricanpaladin sends brownie points to @dardandemiri :sparkles: :thumbsup: :sparkles:
:warning: am3ricanpaladin already gave dardandemiri points
formatted code
:bulb: to format code use backticks! ``` more info
for ( var i = 0; i < contact.length; i++ ) {
if ( contact[ i ].firstName == firstName ) {
if ( contact[ i ].prop === "" ) {
return "No such property";
} else {
return contact[ i ].prop;
} // else end
} // if outer end
} // for end
return "No such contact";
Hey folks, running into 2 big snags on my Twitch Status project.
I can't seem to nail down img resizing for the profile pictures. I'm trying to have it center inside of the div but to the left of the status infomation. Float:left sorta worked but still having issues with resizing.
Also, I can't seem to figure out how to get my online streamers to show up first. Not exactly sure how I would prioritze online divs to show over the top of offline divs.
pen is here. http://codepen.io/johndsykes86/pen/RaQabe
js for ( var i = 0; i < contact.length; i++ ) {
if ( contact[ i ].firstName == firstName ) {
if ( contact[ i ].prop === "" ) {
return "No such property";
} else {
return contact[ i ].prop;
} // else end
} // if outer end
} // for end
return "No such contact";
pawan92 sends brownie points to @gregatgit :sparkles: :thumbsup: :sparkles:
:star: 400 | @gregatgit | http://www.freecodecamp.com/gregatgit
$(window).resize(function() {
viewportHeight = $(window).height();
$('#sectionHome').css("height", viewportHeight);
$('#sectionAbout').css("height", viewportHeight);
});
array[i].property==""
var viewportHeight = $(window).height();
$('#sectionHome').css("height", viewportHeight);
$('#sectionAbout').css("height", viewportHeight);
$(window).resize(function() {
viewportHeight = $(window).height();
$('#sectionHome').css("height", viewportHeight);
$('#sectionAbout').css("height", viewportHeight);
});
.getElementById
johndsykes86 sends brownie points to @gregatgit :sparkles: :thumbsup: :sparkles:
:star: 401 | @gregatgit | http://www.freecodecamp.com/gregatgit
jalley3 sends brownie points to @adzam5 :sparkles: :thumbsup: :sparkles:
:star: 400 | @adzam5 | http://www.freecodecamp.com/adzam5
if ( contact[ i ].prop === "" ) {
return "No such property";
} else {
return contact[ i ].prop;
}
contact[ i ].prop === ""
will evaluate as false
prop
doesn't exist
undefined
contact[ i ].prop === undefined
obj.hasOwnProperty(prop)
that tells you if the property is there or not
contact[i].hasOwnProperty(prop)
contacts[ i ].hasOwnProperty(prop)
contact[ i ].hasOwnProperty('prop')
return contacts[i].prop;
contact[ i ].hasOwnProperty('prop') === false
does it return false
you're really asking if the property isn't there
return contacts[i].prop;
is returning
return contacts[i][prop]
;
.prop
will actually look up the prop
attribute which isn't what you want
if(contacts[i].hasOwnProperty(prop)){
// do this
}else{
// do that
}
if ( contacts[ i ].hasOwnProperty('prop') ) {
return contacts[ i ][prop];
} else {
return "No such property";
} // else end
hasOwnProperty(prop)
something.hasOwnProperty('prop')
jkid314159 sends brownie points to @juliankrispel :sparkles: :thumbsup: :sparkles:
something.hasOwnProperty(prop)
:warning: could not find receiver for juliankrispel
jkid314159 sends brownie points to @gregatgit :sparkles: :thumbsup: :sparkles:
:star: 402 | @gregatgit | http://www.freecodecamp.com/gregatgit
the-mister sends brownie points to @adzam5 :sparkles: :thumbsup: :sparkles:
:star: 401 | @adzam5 | http://www.freecodecamp.com/adzam5
prop
contains
for ( var i = 0; i < contacts.length; i++ ) {
if ( contacts[ i ].firstName == firstName ) {
if ( contacts[ i ].hasOwnProperty(prop) ) {
return contacts[ i ][prop];
} else {
return "No such property";
} // else end
} // if outer end
} // for end
random-x sends brownie points to @gregatgit :sparkles: :thumbsup: :sparkles:
:star: 403 | @gregatgit | http://www.freecodecamp.com/gregatgit
manmarziyan sends brownie points to @zerazera :sparkles: :thumbsup: :sparkles:
:star: 323 | @zerazera | http://www.freecodecamp.com/zerazera
$scope.results.push({title: v.title, body: v.extract, page: page + v.pageid})
https://en.wikipedia.org/w/api.php?action=query&generator=allpages&format=json&gaplimit=4&gapfrom=T&prop=info|extracts
michaeltsang sends brownie points to @trip16661 :sparkles: :thumbsup: :sparkles:
:warning: michaeltsang already gave trip16661 points
bewsii sends brownie points to @michaeltsang :sparkles: :thumbsup: :sparkles:
:star: 282 | @michaeltsang | http://www.freecodecamp.com/michaeltsang
boskoivic sends brownie points to @bewsii and @kirbyedy :sparkles: :thumbsup: :sparkles:
:star: 828 | @kirbyedy | http://www.freecodecamp.com/kirbyedy
:star: 130 | @bewsii | http://www.freecodecamp.com/bewsii
http://img.photobucket.com/albums/v719/kobajagrande/3D%20djubre/LRv2_f3.jpg
http://img.photobucket.com/albums/v719/kobajagrande/3D%20djubre/A3sbRed_1600x1200raw.jpg
button:nth-child(4) {
background-color: yellow;
}
button:nth-child(4):hover {
background-color: yellow;
}
button:nth-child(4):hover:focus {
background-color: yellow;
}
@Heyjp Yep just do this:
button:nth-child(4), button:nth-child(4):hover, button:nth-child(4):hover:focus {
background-color: yellow;
}
That should work
heyjp sends brownie points to @belax8 :sparkles: :thumbsup: :sparkles:
:star: 276 | @belax8 | http://www.freecodecamp.com/belax8
// Setup
var myObj = {
gift: "pony",
pet: "kitten",
bed: "sleigh"
};
function checkObj(checkProp) {
// Your Code Here
myVar=myObj.hasOwnProperty("checkProp");
if (myVar==true)
{
return myObj.myVar;
}
else {
return "Not Found";
}
}
// Test your code by modifying these values
checkObj("gift");
sroy8091 sends brownie points to @sjames1958gm and @random-x :sparkles: :thumbsup: :sparkles:
:star: 133 | @random-x | http://www.freecodecamp.com/random-x
:star: 580 | @sjames1958gm | http://www.freecodecamp.com/sjames1958gm
$(document).ready(function(){
var link = "https://en.wikipedia.org/w/api.php?action=query&format=json&prop=extracts&generator=search&exsentences=1&exlimit=15&exintro=1&exsectionformat=wiki&gsrsearch=Apple"
$.getJSON(link,function(data){
var pages = data.query.pages;
var sorted = [];
$.each(pages,function(key,value){
console.log(key+value.title);
})
});
});
michaeltsang sends brownie points to @random-x :sparkles: :thumbsup: :sparkles:
Hi, I'm CamperBot! I can help you in this chatroom :smile:
find TOPIC
find all entries about topic. ex: find js
wiki TOPIC
show contents of topic pagethanks @username
send brownie points to another userabout @username
shows info on that userAlgorithm BONFIRENAME
info on a Algorithm:speech_balloon: meet CamperBot in this room!
:star: 134 | @random-x | http://www.freecodecamp.com/random-x
$(document).ready(function(){
var link = "https://en.wikipedia.org/w/api.php?action=query&format=json&prop=extracts&generator=search&exsentences=1&exlimit=15&exintro=1&exsectionformat=wiki&gsrsearch=Apple"
$.getJSON(link,function(data){
var pages = data.query.pages;
var sorted = [];
$.each(pages,function(key,value){
sorted.push(value);
})
sorted.sort(function(a,b){
return a.index - b.index;
});
console.log(sorted);
});
});
encodeURI("https://en.wikipedia.org/wiki/Apple II series")
find api
:zero: capitalize first letter of string
:one: challenge escaping literal quotes in strings
:two: creating a new api endpoint
:three: front end project use the twitchtv json api
:four: more useful apis
git add octocat.txt
git status
it will give you the correct output, etc
kirbyedy sends brownie points to @markmurphy06 :sparkles: :thumbsup: :sparkles:
:star: 135 | @markmurphy06 | http://www.freecodecamp.com/markmurphy06
nazimkazim sends brownie points to @dagman :sparkles: :thumbsup: :sparkles:
:star: 387 | @dagman | http://www.freecodecamp.com/dagman
$.getJSON('http://ipinfo.io', function(data){
var Latitude = data.loc;
var Longitude = data.loc;
console.log(data);
console.log(Latitude);
console.log(Longitude);
})
var Latitude = data.loc.split(" ")[0];
and console.log show a string of coordinates 49.8119,73.0969
nazimkazim sends brownie points to @jdtdesigns :sparkles: :thumbsup: :sparkles:
:star: 396 | @jdtdesigns | http://www.freecodecamp.com/jdtdesigns
display: block;
and float: left;
and it seemed to work for me. But I'm not sure that is what you are going for.
arminasbek sends brownie points to @jdtdesigns :sparkles: :thumbsup: :sparkles:
:star: 397 | @jdtdesigns | http://www.freecodecamp.com/jdtdesigns
arminasbek sends brownie points to @jdtdesigns :sparkles: :thumbsup: :sparkles:
:warning: arminasbek already gave jdtdesigns points
&callback=?
{"error":"Unprocessable Entity","message":"Channel 'brunofin' is unavailable","status":422}/
if(data.error == true)
return a true or false?
random-x sends brownie points to @dhcodes :sparkles: :thumbsup: :sparkles:
:star: 601 | @dhcodes | http://www.freecodecamp.com/dhcodes
reubenv sends brownie points to @juwdohr :sparkles: :thumbsup: :sparkles:
:star: 294 | @juwdohr | http://www.freecodecamp.com/juwdohr
-u
in git push -u origin master
stands for?
$("#buttonID").prop("disabled", true);
For example...
"employees": [
{
"id": "01",
"firstName": "John",
"lastName": "Doe",
},
How would I add "phone": "123-456-7890"
jaredabel sends brownie points to @random-x and @sjames1958gm :sparkles: :thumbsup: :sparkles:
:star: 591 | @sjames1958gm | http://www.freecodecamp.com/sjames1958gm
:star: 137 | @random-x | http://www.freecodecamp.com/random-x
adzam5 sends brownie points to @animsaj and @sjames1958gm :sparkles: :thumbsup: :sparkles:
:star: 478 | @animsaj | http://www.freecodecamp.com/animsaj
:star: 592 | @sjames1958gm | http://www.freecodecamp.com/sjames1958gm
Object {stream: null, _links: Object}
_links
:
Object
channel
:
"https://api.twitch.tv/kraken/channels/freecodecamp"
self
:
"https://api.twitch.tv/kraken/streams/freecodecamp"
__proto__
:
Object
stream
:
null
__proto__
:
Object
twitch api offline user info
dardandemiri sends brownie points to @sjames1958gm :sparkles: :thumbsup: :sparkles:
:star: 593 | @sjames1958gm | http://www.freecodecamp.com/sjames1958gm
elvisthestriker sends brownie points to @dardandemiri :sparkles: :thumbsup: :sparkles:
:star: 286 | @dardandemiri | http://www.freecodecamp.com/dardandemiri
[
{
"quote":"Happiness is not something you postpone for the future; it is something you design for the present.",
"author":"Jim Rohn"
},
{
"quote":"What you do today can improve all your tomorrows.",
"author":"Ralph Marston"
}
}
alinatsui sends brownie points to @dardandemiri :sparkles: :thumbsup: :sparkles:
:star: 287 | @dardandemiri | http://www.freecodecamp.com/dardandemiri
var array = [
"Happiness is not something you postpone for...",
"Another quote ... etc etc"
];
// And you access them
array[ Math.round(Math.random() * array.length)];
alinatsui sends brownie points to @dardandemiri :sparkles: :thumbsup: :sparkles:
var randomNR = Math.round(Math.random() * array.length);
array[randomNR];
:warning: alinatsui already gave dardandemiri points
$('#searchInput').on('keyup', function() {
var input = $(this);
});
$(".streamers").css("display","none");
jdramos sends brownie points to @animsaj :sparkles: :thumbsup: :sparkles:
:star: 480 | @animsaj | http://www.freecodecamp.com/animsaj
"title": "My Resume"
},{
"title": "Highlights of Qualifications
",
"body”: “sdafsdfasfd”
}]
error
function
stharrison1 sends brownie points to @coymeetsworld :sparkles: :thumbsup: :sparkles:
:star: 520 | @coymeetsworld | http://www.freecodecamp.com/coymeetsworld
dueldrawer8 sends brownie points to @sjames1958gm :sparkles: :thumbsup: :sparkles:
:star: 596 | @sjames1958gm | http://www.freecodecamp.com/sjames1958gm
i
based on the array position
dueldrawer8 sends brownie points to @ehekatlof and @sjames1958gm :sparkles: :thumbsup: :sparkles:
:warning: dueldrawer8 already gave sjames1958gm points
:star: 249 | @ehekatlof | http://www.freecodecamp.com/ehekatlof
.append()
jhcastanod sends brownie points to @juwdohr :sparkles: :thumbsup: :sparkles:
:star: 295 | @juwdohr | http://www.freecodecamp.com/juwdohr
jhcastanod sends brownie points to @ehekatlof :sparkles: :thumbsup: :sparkles:
:star: 250 | @ehekatlof | http://www.freecodecamp.com/ehekatlof
$.each(data, function(){
console.log(data.query.search[i].snippet);
})
}
data.query.search.forEach(function(entry) {
console.log(entry.snippet);
})
dueldrawer8 sends brownie points to @sjames1958gm :sparkles: :thumbsup: :sparkles:
:warning: dueldrawer8 already gave sjames1958gm points
$.each(data.query.search, function(index, entry){
console.log(entry.snippet);
})
<div class="container">
<div id="center">
<input type ="textbox" placeholder="search">
<input type="submit" value="Submit">
</div>
</div>
#center {
margin: 100px auto;
}
width: 100px;
margin: auto;