These are chat archives for FreeCodeCamp/HelpFrontEnd

2nd
Jun 2018
mstellaluna
@mstellaluna
Jun 02 2018 01:54
@markclynch there is an open issue for that on the repo
Zack Adams
@mindforcode
Jun 02 2018 08:07
Hi guys!
Aita Kane
@aita-kane
Jun 02 2018 08:52
@mindforcode hello
Jefferson
@jeffersonnnn
Jun 02 2018 09:15

Can i get help with this code. I am trying to get information(contacts) from an API rendered on a HTML table, but i can't seem to get the logic proper. Here is the jQuery logic

$('#mnu_contact').on('click', function () {
    curSelPage = "contacts";
    $('#nav_title').text('Contacts');
    showMainMenu(false);
    $.get( SERVER_URL+'/contacts.json', function(r_data) {
        var contacts = r_data;
        for (i in contacts) {
           $('#ul_sub_menu').append('<li><a href="#" class="item-link" onclick="selContact('+contacts[i]['id']+')"><div class="item-content">'+contacts[i]['name']+'</div></a></li>');
        } 
    });    

});

and here is the HTML end


<div class="page" data-page="page-contact">
    <div class="page-content">
        <div style="text-align: right;padding:20px;">
            <a href="#" onclick="onClickContactEdit({{contact['id']})">Edit</a>  &nbsp;
            <a href="#" onclick="onDeleteContact({{contact['id']})">Delete</a>                  
        </div>
        <div id="mnu_contact">
            <div class="row center"><h2>{{contact['name']}}</h2></div>
            <div class="center">{{contact['company']}}</div>
            <div class="">Phones</div>
            <div class="">{{contact['phones']}}</div>
            <div class="">Emails</div>
            <div class="">{{contact['emails']}}</div>
            <div class="">Addresses</div>
            <div class="">{{contact['physical_addresses']}}</div>
        </div>        
    </div>
</div>

help pleaseee

Hermanis Ozols
@hermanisozols_twitter
Jun 02 2018 09:41
maybe someone could help me with the random quote generator
my problemis that share on twitter only works after generating new quote
dinesh
@1532j0004kg
Jun 02 2018 09:43
@hermanisozols_twitter It is inside the click function !
It will only work if u click the #getMessage
Hermanis Ozols
@hermanisozols_twitter
Jun 02 2018 09:46
yes
i fixed that
but now i have another bug
it doesnt tweet the quote
dinesh
@1532j0004kg
Jun 02 2018 09:48
post your updated code
Hermanis Ozols
@hermanisozols_twitter
Jun 02 2018 09:48
$(".twitter").html(
'<a id="tweetmsg" ' + 'class="btn btnherozo text-center" ' + 'target="_blank" ' + 'href="https://twitter.com/intent/tweet?text=' + ".message" + '">Share on twitter' +
'</a>'
);
dinesh
@1532j0004kg
Jun 02 2018 09:48
put your link
Hermanis Ozols
@hermanisozols_twitter
Jun 02 2018 09:49
just saved it
rerun it
dinesh
@1532j0004kg
Jun 02 2018 09:51
It is working!
Hermanis Ozols
@hermanisozols_twitter
Jun 02 2018 09:51
share on twitter isnt
dinesh
@1532j0004kg
Jun 02 2018 09:52
may be its twitter problem
Click tweet
It is ending the program
Hermanis Ozols
@hermanisozols_twitter
Jun 02 2018 09:53
dinesh
@1532j0004kg
Jun 02 2018 09:53
Your code is good
Hermanis Ozols
@hermanisozols_twitter
Jun 02 2018 09:53
.message doesnt work
dinesh
@1532j0004kg
Jun 02 2018 09:53
It's their problem ,.!
dont put it inside the doublequotes
So what is .message refers?
Its wrong code
Hermanis Ozols
@hermanisozols_twitter
Jun 02 2018 09:56
to the html class
where the quote goes
probably better idea to use id
dinesh
@1532j0004kg
Jun 02 2018 09:57
.message is not variable
For posting you must store the quote in variable otherwise directly give the quote !
So, In this case what you want to post in tweet ?
give x for the quote
Hermanis Ozols
@hermanisozols_twitter
Jun 02 2018 10:00
i want to tweet the generated tweet
so i have to get var with the quote
dinesh
@1532j0004kg
Jun 02 2018 10:01
So give x
because your randomly generated quote is inside the x variable !
Hermanis Ozols
@hermanisozols_twitter
Jun 02 2018 10:02
yes
but it doesnt really work
i tried it
dinesh
@1532j0004kg
Jun 02 2018 10:03
Put your link !
dinesh
@1532j0004kg
Jun 02 2018 10:03
Quote is changing !
Hey man !
Hermanis Ozols
@hermanisozols_twitter
Jun 02 2018 10:06
okay i got the global var
dinesh
@1532j0004kg
Jun 02 2018 10:07
 $("#getMessage").on("click", function getQuote(){
      // Only change code below this line.
      var randomq = quotes[getRandomInt()];
      $(".message").html(randomq);
      // Only change code above this line.
      x = quotes[getRandomInt()];

        $(".twitter").html(
  '<a id="tweetmsg" ' + 
     'class="btn btnherozo text-center" ' + 
     'target="_blank" ' + 
     'href="https://twitter.com/intent/tweet?text=' + x + 
     '">Share on twitter' + 
  '</a>'
);
Nam V. Do
@fantasy2943
Jun 02 2018 10:20
How can I get 3 images in a row html repsonsive and text-link display below each image in bootstrap?
Dhaval Vira
@dhavalveera
Jun 02 2018 10:21
use bootstrap grid system
with that you will get 3 images in a row with responsiveness
Nam V. Do
@fantasy2943
Jun 02 2018 10:22
How can I use it?
dinesh
@1532j0004kg
Jun 02 2018 10:23
Do you know bootstrap @fantasy2943 ?
Nam V. Do
@fantasy2943
Jun 02 2018 10:24
This is how my code display
image.png
dinesh
@1532j0004kg
Jun 02 2018 10:25
<figure>
  <img src="img_pulpit.jpg" alt="The Pulpit Rock" width="304" height="228">
  <figcaption>Fig1. - A view of the pulpit rock in Norway.</figcaption>
</figure>
Divyesh Parmar
@Tapudp
Jun 02 2018 10:31

So I have been trying to create a simple blog site with Node.js/Express.js app you guys can see it here,

I have very big problems happening, I have used ckeditor to make the blogs write in a way that What you see is what you get editor, I can write the content with formatting but how to render that blog/article data with formatting on the ejs template

Also I have must have tried dozens of answers on stackoverflow as well as other CSS files, but I am unable to make the Footer stick to the bottom of the page, I'm using simple Bootstrap-3.3.7 but I don't know what's wrong.

Any guidance/explanation would help. Thank you

PS How can I add editing and formatting of the post/comment like Reddit, Dev.to, it is actually awesome to have bold fonts with BOLD or italics italics

Pieter Stokkink
@forkerino
Jun 02 2018 10:45
Does anyone else experience problems with the Sass @for and @each lessons? I have the correct style spitting out, but the tests fail.
Zack Adams
@mindforcode
Jun 02 2018 10:58
How are you guys liking the new code camp?
Daria Doronina
@Skidle
Jun 02 2018 10:58
Pieter Stokkink
@forkerino
Jun 02 2018 10:58
buggy :bug: :beetle: @mindforcode
Zack Adams
@mindforcode
Jun 02 2018 10:58
Really? whats going on?
You'd think with an army of coders sitting around it'd be bulletproof, no?
Pieter Stokkink
@forkerino
Jun 02 2018 11:00
There were quite some problems for people in the past few days, I've noticed here in the chatrooms. I often get logged out if I go to the curriculum page, for example, but also have an issue with specific challenges not passing with correct code.
Daria Doronina
@Skidle
Jun 02 2018 11:00
lol okay, I just need to include it in the script tag
Divyesh Parmar
@Tapudp
Jun 02 2018 11:03
@mindforcode i don't like new FCC it lost the map
And i always get the sign in button
Even if I'm logged in i can't see the completed problems list
Pieter Stokkink
@forkerino
Jun 02 2018 11:05
@mindforcode One thing I would really like to see when tests are failing is the expected and actual outcome. Maybe it is there for other challenges, but I have some issue with a Sass challenge where it says that a font-size should be 10px when it in fact is 10px.
Zack Adams
@mindforcode
Jun 02 2018 11:08
is that a new issue?
I don't remeber running into that one in the previous version
but i never got SUPER deep into FCC
Pieter Stokkink
@forkerino
Jun 02 2018 11:13
I don't know how new that is. I just noticed the new version being live, didn't do any challenges for over a year, so can't really say.
Zack Adams
@mindforcode
Jun 02 2018 11:36
i do like that they've updfated and added some new/fresh content tho
Pieter Stokkink
@forkerino
Jun 02 2018 11:41
Oh, for sure, I'll just hold off a bit until all the kinks have been worked out.
abraham anak agung
@padunk
Jun 02 2018 11:59
I always confuse between sign up and sign in, why not register and log in?
Zack Adams
@mindforcode
Jun 02 2018 12:04
bad ux
abraham anak agung
@padunk
Jun 02 2018 12:05
just sign in to new fcc, they font get smaller, but they have tons of new challenges
Gulsvi
@gulsvi
Jun 02 2018 16:20
John Su
@JSN190
Jun 02 2018 16:36
Is there any way to remove the dotted outline that Firefox forces upon dropdown menus? I've implemented my own outline that I want to make universal across all browsers, but I can't seem to get rid of the former. I've already tried ::-moz-focus-inner { border: 0 } and outline: none on the :focus selector.
select:-moz-focusring {
    color: transparent;
    text-shadow: 0 0 0 #000;
}
Valeriy Stepanov
@bskydive
Jun 02 2018 20:39
hello! Please, help me to create rxjs observables from every element of array [1,2,3,...].
markclynch
@markclynch
Jun 02 2018 21:03
So how important is ES6 Destructuring Assignments? Cause I just don't get it, or understand the problem it tries to solve.
If it is important can someone walk me through it a little?
Alexandar B
@ace1122sp
Jun 02 2018 21:09
besides shorter syntax, i don't know if it brings anything else, like performance enhancement or something..
hensn5250
@hensn5250
Jun 02 2018 21:21
@markclynch Heard of it. Don't understand the hype behind it. I guess its one of those things that you won't like until you have to use it cause its everywhere, like arrow functions.
Just got this from google: https://wesbos.com/destructuring-objects/
hensn5250
@hensn5250
Jun 02 2018 21:39
Moisés Man
@moigithub
Jun 02 2018 21:48
@markclynch used a lot on react tutorials, where properties are passed to components (as objects, this is how react is build)
soo if u have multiples "values" instead of doing
this.props.value1, this.props.value2, this.props.value2, this.props.value3 <-- a lot of typing u could use destructuring to shorten the code
const {value1, value2, value3} = this.props;
markclynch
@markclynch
Jun 02 2018 21:49
@moigithub That makes some sense then!
@hensn5250 Thanks good articles
@moigithub Also good to know, since I really need to learn React/Redux, but realized I was having so many problems cause I didn't understand ES6
React is really a ton of ES6 stuff in there huh
const LOCAL_FORECAST = {
  today: { min: 72, max: 83 },
  tomorrow: { min: 73.3, max: 84.6 }
};

function getMaxOfTmrw(forecast) {
  "use strict";
  // change code below this line
  const { tomorrow : { minOfTomorrow: x, max: maxOfTomorrow}} = forecast; // change this line
  // change code above this line
  return maxOfTomorrow;
}

console.log(getMaxOfTmrw(LOCAL_FORECAST)); // should be 84.6
what's the problem with this? Why is it saying I'm not using nesting, it feels like I am.
markclynch
@markclynch
Jun 02 2018 21:59
@moigithub Any idea on this?
Alexandar B
@ace1122sp
Jun 02 2018 22:01
@markclynch where did you get that x? take a close look at that part of the code..
markclynch
@markclynch
Jun 02 2018 22:04
@ace1122sp const { tomorrow : { min: minOfTomorrow, max: maxOfTomorrow}} = LOCAL_FORECAST;
still not passing though. Says it's not nesting
I just thought x was a placeholder
Alexandar B
@ace1122sp
Jun 02 2018 22:05
huh... can you pass me the link?
I get the correct answer with my code, but I don't pass the nested deconstrucuring test
Moisés Man
@moigithub
Jun 02 2018 22:08

Use destructuring assignment to obtain max of forecast.tomorrow and assign it to maxOfTomorrow

probably they dont want min

Alexandar B
@ace1122sp
Jun 02 2018 22:08
yeah, that's it ...
just for max...
Moisés Man
@moigithub
Jun 02 2018 22:11
soo u can remove min and its "alias"
markclynch
@markclynch
Jun 02 2018 22:12
Thanks yeah, that was it
Feels like there should be better ways to grade these tests.
@moigithub thanks
Moisés Man
@moigithub
Jun 02 2018 22:14
:+1:
Abdus Samad
@asamad123
Jun 02 2018 23:15
hi
anyone home?

so i was playing with the javascript date api. It seems that the times are working, but when it comes to days and month it all displays as numbers. So i decided that i will transfer those numbers to words by using arrays. But not sure quite how to do this. I have this array.

    let weekdays = ['Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday','Saturday', 'Sunday'];

So how would i put this in a forloop to make sure that the 7 numbers == to all those seven days

markclynch
@markclynch
Jun 02 2018 23:19
?
Why do you need to use a for loop?
You can use the number 1 - 7 to equal the weekdays[index]
Abdus Samad
@asamad123
Jun 02 2018 23:22
but i want the days to be in letters not in numbers
markclynch
@markclynch
Jun 02 2018 23:22
I'm saying if the date api gives you back numbers Monday = 1 etc.
Abdus Samad
@asamad123
Jun 02 2018 23:23
Exactly but i want it to be in letters like 1 - monday, 2 -tuesday vice versa
markclynch
@markclynch
Jun 02 2018 23:23
so then weekdays[x-1] = (the day your looking for)
where x is the returned number
-1 and it equals the correct index for weekdays
Abdus Samad
@asamad123
Jun 02 2018 23:24
using forloop?
markclynch
@markclynch
Jun 02 2018 23:24
no, don't need a for loop
Abdus Samad
@asamad123
Jun 02 2018 23:24
oh sorry then how?
markclynch
@markclynch
Jun 02 2018 23:24
What does the date api give you as a result?
or can you link me to the code?
Abdus Samad
@asamad123
Jun 02 2018 23:25
so this is what i have
function myDates(){

    // arrays of Months
    let Months = ['January', 'February', 'March', 'April', 'May','June', 'July'];

    // arrays of days
    let weekdays = ['Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday','Saturday', 'Sunday'];

    // all date variables
    const time = new Date();
    const seconds = time.getSeconds();
    const hour = time.getHours();
    const minute = time.getMinutes();
    const day = time.getDay();
    const Month = time.getFullYear();
    // const Month = time.getMonth();

    // all html ids
    const hours = document.querySelector('.hour');
    const two = document.querySelector('.two');
    const second = document.querySelector('.second');

      // function to turn the variables to html
      function myDates(id, variable){
      id.innerHTML = '<p>' +variable+ ' : '+ '</p>';
      }

      // functions turned into html
      myDates(hours, hour);
      myDates(two, minute);
      myDates(second, seconds);
  }


  // repeat every 1 sec
  setInterval(myDates, 1000);
markclynch
@markclynch
Jun 02 2018 23:28
You have a codepen link?
Abdus Samad
@asamad123
Jun 02 2018 23:28
sure
let me make one :)
markclynch
@markclynch
Jun 02 2018 23:29
okay haha
Bjorn van de Peut
@bjorno43
Jun 02 2018 23:57
@asamad123 Did you solve it?