Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Activity
  • Aug 17 09:32
    User @bjorno43 unbanned @linkin-park
  • Jun 20 21:19
    @bjorno43 banned @shenerd140
  • Apr 25 17:13
    @mstellaluna banned @cmal
  • Jan 08 22:05
    @mstellaluna banned @dertiuss323
  • Nov 07 2018 04:42
    User @texas2010 unbanned @ows-ali
  • Nov 02 2018 16:25
    @texas2010 banned @ows-ali
  • Oct 12 2018 05:50
    @bjorno43 banned @NACH74
  • Oct 05 2018 23:02
    @mstellaluna banned @JomoPipi
  • Sep 16 2018 12:21
    @bjorno43 banned @yash-kedia
  • Sep 16 2018 12:16
    @bjorno43 banned @vnikifirov
  • Sep 05 2018 08:12
    User @bjorno43 unbanned @androuino
  • Sep 05 2018 07:38
    @bjorno43 banned @androuino
  • Aug 23 2018 16:57
    User @bjorno43 unbanned @rahuldkjain
  • Aug 23 2018 16:23
    @bjorno43 banned @rahuldkjain
  • Jul 29 2018 14:13
    User @bjorno43 unbanned @jkyereh
  • Jul 29 2018 01:00
    @bjorno43 banned @jkyereh
  • Jul 10 2018 22:09
    @bjorno43 banned @manafn
  • Jul 06 2018 15:20
    @texas2010 banned @imlegend19
  • Jul 03 2018 12:28
    @bjorno43 banned @vbvmatta
  • Jun 29 2018 13:54
    @bjorno43 banned @OGTechnoBoy
mboesiger90
@mboesiger90
help I am stuck with the random quote machine. It does not generate a code with this:

$(document).ready(function(){
$.ajax({
type: 'GET',
dataType: 'json',
url: '/wp-json/posts?filter[orderby]=rand&filter[posts_per_page]=1',
success:function(data){
$(".quote").html(data.qouteText + "<br>" + data.qouteAuthor)
}
});
$("#getQoute").on("click", function (){

$.ajax({
type: 'GET',
dataType: 'json',
url: '/wp-json/posts?filter[orderby]=rand&filter[posts_per_page]=1',
success:function(data){
$(".quote").html(data.qouteText + "<br>" + data.qouteAuthor)
}
});
cache: false;
});
});

ZaynMalloc
@ZaynMalloc
@adamakers I think the problem might be that you did not create a new person object.
fdemaa
@fdemaa
using negative margins is not a good solutions right ? xd
ZaynMalloc
@ZaynMalloc

@adamakers function Person(saying) {
this.saying = saying;
this.tacos = 'taco express';
this.me = false;
}

Person.prototype.talk = function() {
console.log('I say: ' + this.saying);
}

var newPerson = new Person('Hello')

console.log(newPerson.talk());

Dillon Orr
@dillorr
What's the best way to add a headshot to my portfolio page? i have an image hosted on google images but none of the links work
I can't get a direct link to the image
had the same issue with imgur
Gulsvi
@gulsvi
@joshbeasley This section of the Bootstrap docs talks about aligning your nav components: https://v4-alpha.getbootstrap.com/components/navs/#horizontal-alignment
Adam
@adamakers
@ZaynMalloc it does similar thing here:
function Person(name, gender) {
  this.name = 5;
  this.gender = 5;
}
Person.prototype.lastname = 'marsh';
Person.prototype.introduce = function() {
  console.log('Hi my name is ' + this.name + ' and I am a ' + this.gender);
}

var stan = new Person('Stanley', 'male');

console.log(Person.prototype);
Gulsvi
@gulsvi
@mboesiger90 Hint - the URL you have should start with https:// your URL is:
'/wp-json/posts?filter[orderby]=rand&filter[posts_per_page]=1'
@dillorr Use a service like https://postimage.org, that's what most people use here without any issues.
Dillon Orr
@dillorr
I'll give it a shot, thanks again @SkyC0der
CamperBot
@camperbot
dillorr sends brownie points to @skyc0der :sparkles: :thumbsup: :sparkles:
:warning: dillorr already gave skyc0der points
fdemaa
@fdemaa
@SkyC0der when i remove the padding from my body,and put it in my div, my image is got cut, and it doesn't matter if put other height to the image, it wont display.
If i use margin-top: with a negative value, is a bad solution ?
mboesiger90
@mboesiger90
ah yes thank you sky but when I changed that it still doesnt work
Gulsvi
@gulsvi
@mboesiger90 What does your URL look like now?
I went with a different API
Gulsvi
@gulsvi
@fdemaa A better solution, in that case, is to move your home section above your navbar, like:
<div id="home"></div>
  <div class="container-fluid  homesection">  
  <nav class="navbar  navbar-inverse navbar-fixed-top custom1">
@mboesiger90 That API is not documented very well - I can give you the exact URL to use if you want, but you may not learn much about reading API documentation. Up to you.
I'd personally take a closer look at the code examples and instructions at the first API you were trying to use: https://quotesondesign.com/api-v4-0/
mboesiger90
@mboesiger90
ok thank you
ZaynMalloc
@ZaynMalloc

@adamakers function Person(name, gender) {
this.name = name;
this.gender = gender;
}
Person.prototype.lastname = 'marsh';
Person.prototype.introduce = function() {
console.log('Hi my name is ' + this.name + ' and I am a ' + this.gender);
}

var stan = new Person('Stanley', 'male');

console.log(stan.introduce());

Gulsvi
@gulsvi
Once you get more familiar with calling APIs, displaying data on the page, etc, you can branch out and try to figure out other APIs.
Adam
@adamakers
@ZaynMalloc I figured it out. It does not show the properties in the console because those properties are not a part of the prototype property, but instead are tied directly to the object
mboesiger90
@mboesiger90
Ok thank you I am really struggling to understand ajax and apis
Dillon Orr
@dillorr
@SkyC0der you mentioned earlier z-index: -1; for my navigation bar, which i applied to that class, but now my new image is the only thing that covers it up when scrolling
everything else scrolls under the nav bar like it's supposed to
ZaynMalloc
@ZaynMalloc
@adamakers oh, good to know
Gulsvi
@gulsvi
@mboesiger90 Don't let it get you down :) it's a tough concept, but it will click eventually and then seem fairly simple.
Just takes getting it right a few times
Adam
@adamakers
@ZaynMalloc Thanks!
CamperBot
@camperbot
adamakers sends brownie points to @zaynmalloc :sparkles: :thumbsup: :sparkles:
:cookie: 254 | @zaynmalloc |http://www.freecodecamp.com/zaynmalloc
Gulsvi
@gulsvi
@dillorr You'll want to use a positive number for your z-index. I don't think I recommended a negative one :) but if I did, I'm sorry about that. -1 puts your element behind everything else.
Dillon Orr
@dillorr
whoops! got it
Gulsvi
@gulsvi

For example, this is what Bootstrap does for their Fixed navbar class:

.navbar-fixed-top,
.navbar-fixed-bottom {
  position: fixed;
  right: 0;
  left: 0;
  z-index: 1030;
}

@dillorr
From: https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/3.3.7/css/bootstrap.css

fdemaa
@fdemaa
@SkyC0der still the white space, i think i will add the negative margin to each mediaqueries :shipit:
mboesiger90
@mboesiger90
is there anything in particular I can read up on to help me understand APIs better?
Josh Beasley
@joshbeasley
@SkyC0der the justify-content-end class allowed me to move the entire nav bar, but not individual pills
fdemaa
@fdemaa
@SkyC0der okey i do it like you ! but why that works ? moving the id home up there ?
Gulsvi
@gulsvi
@joshbeasley I misread, thought you wanted it all over to the right. I think you're looking for a navbar, not nav-pills in that case. https://codepen.io/skycoder/pen/VboOYK?editors=1000
@fdemaa This way, the navbar is on top of your background image instead of above it :) it's the same as using the <header> tag.
fdemaa
@fdemaa
okay i never thought about that !you are years ahead of me haha
Gulsvi
@gulsvi
Only 3 months lol :)
fdemaa
@fdemaa
:clap: