These are chat archives for FreeCodeCamp/HelpFrontEnd

7th
Jun 2018
Keggatron
@Keggatron
Jun 07 2018 00:50
I'm trying to deploy my static pageto Heroku but I'm receiving an error H81 in the heroku logs.
I've tried a few things such as create a PHP file to 'trick' heroku into thinking it's an app however that doesn't seem to be working
By the way the H81 error description is 'Blank App'
any help with this would be appreciated
br3ntor
@br3ntor
Jun 07 2018 01:14
soooo let tempObj = {} vs const tempObj = {} whats the difference if I can still modify and add to const object?
Brad
@bradtaniguchi
Jun 07 2018 01:14
@br3ntor you cant do this
const obj = {}
obj = 5 //NO!
// or
obj = {} //NO!
br3ntor
@br3ntor
Jun 07 2018 01:15
oh yea
Brad
@bradtaniguchi
Jun 07 2018 01:15
JS makes some memory optimzations with const so always start with it no matter what :)
br3ntor
@br3ntor
Jun 07 2018 01:15
can the properties in the object get locked down with a const or something?
Brad
@bradtaniguchi
Jun 07 2018 01:16
nope
br3ntor
@br3ntor
Jun 07 2018 01:16
@bradtaniguchi ty
Brad
@bradtaniguchi
Jun 07 2018 01:16
anyone can do anything to em without doing something fancier than the basic {}
np :D
Aita Kane
@aita-kane
Jun 07 2018 09:14
hello how can i use the modal box in bootstrap , I try everythng butnothing show up?
abraham anak agung
@padunk
Jun 07 2018 09:15
@aita-kane have you try the bootstrap docs? https://getbootstrap.com/docs/4.0/components/modal/
Aita Kane
@aita-kane
Jun 07 2018 09:16
@padunk yes , that's where I got the code
@padunk to make it work(show) do we need js
abraham anak agung
@padunk
Jun 07 2018 09:18
@aita-kane you already download BS right?
no, you don't need JS
also check the demo on codepen.io https://codepen.io/SitePoint/pen/KkHyw?editors=1000
Charlie Waite
@charliearlie
Jun 07 2018 09:39
Well, you do need JS as in including Bootstrap's js file, and i believe you also need to have JQuery?
Aita Kane
@aita-kane
Jun 07 2018 09:42
@charliearlie I mean "by no JS" that's do I have to write a js function that allows the modal to be shown on click, but I already included all the cdn(css, jquery, js)
Charlie Waite
@charliearlie
Jun 07 2018 09:45
Oh, apologies.
then @padunk is right then. It works with none of your own JS like the demo above shows
Aita Kane
@aita-kane
Jun 07 2018 09:46
@charliearlie no apologies needed it's because my question was uncleared .
@charliearlie let me copy/paste that code and try
@charliearlie Do i have to paste at the top of <body> ?
Charlie Waite
@charliearlie
Jun 07 2018 09:51
Paste what? All of the HTML in the demo?
@aita-kane - forgetting to mention people again
Aita Kane
@aita-kane
Jun 07 2018 09:53
@charliearlie no just large modal one
Charlie Waite
@charliearlie
Jun 07 2018 09:55
@aita-kane yes. What version of bootstrap are you using?
Because it's actually not working for me on 4.1.1 too
Aita Kane
@aita-kane
Jun 07 2018 09:55
I did but nothing appears @charliearlie
@charliearlie 4.1.1 actually
@charliearlie maybe it's because i forgot to add the cdn of https://unpkg.com/popper.js
Charlie Waite
@charliearlie
Jun 07 2018 09:57
Yes, so basically it is the order of the script tags
@aita-kane jQuery must be included first
then popper.js
then bootstrap js
Aita Kane
@aita-kane
Jun 07 2018 09:59
@charliearlie alright let me try that
Aita Kane
@aita-kane
Jun 07 2018 10:06
thank you it works now @padunk @charliearlie
Charlie Waite
@charliearlie
Jun 07 2018 10:15
👍🏻
自能
@w89
Jun 07 2018 11:27
Help!!! Is this some kind of bug?How can I get back to the same page and fix my code?
When you write code for FCC challenges ,FCC keeps your code . And it automatically executes your code when you get back to the same page.
But what if your poor code crashed the browser?
This is what happened. My code crashed the browser .
Then I reopened the browser and got back trying to rewrite my code.
But since the code was kept and was automatically executed ,my brower crashed again.
abraham anak agung
@padunk
Jun 07 2018 11:35
@w89 try clear your cache
自能
@w89
Jun 07 2018 12:10
@padunk thanks.
Ali Bulut
@ali27001
Jun 07 2018 12:54
Why do IOS devices not show up as select arrows?
RickArora
@RickArora
Jun 07 2018 12:55
hi
Ali Bulut
@ali27001
Jun 07 2018 13:38
select iOS is not working properly on phones. it does not look ok
Gulsvi
@gulsvi
Jun 07 2018 16:20
@ali27001 The OS controls this, it's hard to override with CSS. You may want to try some suggestions here: https://stackoverflow.com/questions/11185906/select-box-arrow-style/11186039
dverdin83
@dverdin83
Jun 07 2018 18:31
I
I don't see a project review gitter I usually post on forums but not getting any rrsponses on that project feedback for my landing page so posting here https://dverdin83.github.io/kahunaProductLandingPage.html
Nate Mallison
@NJM8
Jun 07 2018 18:36
@dverdin83 There is a room CodeReview for project review, but you can really post anywhere. I noticed when I clicked the navigation buttons the content was behind the header, see if you can get it to scroll further down or do something different there.
dverdin83
@dverdin83
Jun 07 2018 19:15
That took a lot of tweaking fixed it for several screens what were viewing it on? Brand make screen size if you don't mind me asking but other than that ok right?
I will have it go down a bit more when I get home
Kingsley
@Kingwindie
Jun 07 2018 22:07
how can i remove the button created at the top of onScroll
var btn = document.querySelector("#btn");
var navBar = document.querySelector(".navBar");
var body = document.querySelector("body");
var topBtn = document.createElement("button");




window.onscroll = function () {
    var topBtn = document.createElement("button");
    // body.appendChild(topBtn);
    var yAxis = Math.round(window.pageYOffset);
    if (yAxis > 50) {
        navBar.setAttribute("class", "navScroll");
    } else if (yAxis < 50) {
        navBar.setAttribute("class", "navBar");
    }

    //create and add button
    if (yAxis > 1300) {
        topBtn.setAttribute("class", "topBtn");
        topBtn.textContent = "To Top";
        body.appendChild(topBtn);
    } else if (yAxis > window.innerHeight / 2) {
        body.removeChild(topBtn);
    }


};
i have even tried hiding it and it did not work,the debugger says node not found
Nate Mallison
@NJM8
Jun 07 2018 22:14
@dverdin83 I'm on a 13" MBP. You can do it by checking the distance from the top of the screen to the bottom of the header and setting it below that. that way it is always lower.
@Kingwindie you don't want to add the button? remove body.appendChild(topBtn)
Kingsley
@Kingwindie
Jun 07 2018 22:18
i want the button to be removed when i scroll up,to the very top of the page
@dverdin83
Nate Mallison
@NJM8
Jun 07 2018 22:20
I see
I would guess that the if statements aren't doing what you expect. I would log your yAxis as you scroll to see what it looks like
also be careful not to do too much work base on scrolling, scroll events send every pixel move so if someone scrolls 1000 pixels that 1000 events very quickly for your code to run. can easily slow down your app. usually you debounce it so it only runs every 20 calls or so. just look up debounce functions
Kingsley
@Kingwindie
Jun 07 2018 22:27
it's the body.remove that is giving me problems,i have logged it and logged some comments to see if it actually does anything and it does,i can change the background color,but it'll stay that way,even when i scroll back up
@NJM8