These are chat archives for FreeCodeCamp/HelpFrontEnd

27th
Oct 2017
thinsoldier
@thinsoldier
Oct 27 2017 00:32
@korzo is it worth the effort to convert to that versus keeping the pre-existing php setup and just updating the template html & css?
We could easily batch process all the php files to save their html output to .html files thereby creating a static page generator.
Kaz Baig
@kbaig
Oct 27 2017 00:34
then what's the point of migrating to react/angular
it's just static content
korzo
@korzo
Oct 27 2017 00:40
@thinsoldier what is the motivation for a change?
If content changes occasionally, staticgen is good solution as you don't need any backend and you can host it for a penny on Amazon.
Otherwise I suppose PHP is better solution for this.
Adam Faraj
@adamfaraj
Oct 27 2017 00:57
ugh
i need someone to help me debug my shit
Adam Faraj
@adamfaraj
Oct 27 2017 01:02
(function(){


  let dom;


  const init = function(){
    cacheDOM();
    bindEventHandlers();
    twitchResponse();
};


  const cacheDOM = function() {
    dom = {};
    dom.searchText = $(".search-text")[0];
    dom.buttonSearch = $("#button-search");
    dom.online = $("#online");
    dom.offline = $("#offline");
    console.log(dom.buttonSearch);
  };

  const bindEventHandlers = function() {
      dom.buttonSearch.addEventListener("click", onSearchButton);
  };

  const twitchResponse = function(){
    const userArray = ["ESL_SC2", "OgamingSC2", "cretetion", "storbeck", "habathcx", "RobotCaleb", "noobs2ninjas"];
    userArray.forEach(function(user) {
      let api = "https://wind-bow.glitch.me/twitch-api/streams/" + user;
      $.ajax({
        method: 'GET',
        url: api,
        cache: false,
        datatype: "json"
      }).then(function(data){
        console.log(data.stream);
        if (data.stream == null){
          dom.offline.append("<div class='user_container'><span class='user_class'>" + user + ":</span>" +  "<span class='offline'> Offline</span></div> <br>");
        } else {
dom.online.append("<div class='user_container'><span class='user_class'>"+user+ " is streaming " + data.stream.game + ": </span>"+'<a href="'+data.stream.channel.url+'"target=_blank class="online">'+"Online"+'</a>' + "<br>" + "<span class='status'>" + data.stream.channel.status + "</span>" + "<br>" + "<a href='" + data.stream.channel.url + "' target=_blank>" + "<img src ='"+ data.stream.channel.video_banner + "'>" + "</a>" + "<br>" + "<span class='viewers'>Viewers: " + data.stream.viewers + "</span></div>")
        }
      })
    });
  };

  const onSearchButton = function(){
      console.log(dom.searchText);
  };



  init();

 })(jQuery);
keep getting this error message
main.js:24 Uncaught TypeError: dom.buttonSearch.addEventListener is not a function at bindEventHandlers (main.js:24) at init (main.js:9) at main.js:53 at main.js:55
Kaz Baig
@kbaig
Oct 27 2017 01:11
good ol IIFE
@adamfaraj what happens when you replace dom.buttonSearch.addEventListener("click", onSearchButton); at dom.buttonSearch.click(onSearchButton);
just curious
Adam Faraj
@adamfaraj
Oct 27 2017 01:16
@kbaig lol
it worked
fuck
how come it didn't work before?
i always use .addEventListener
korzo
@korzo
Oct 27 2017 01:16
@adamfaraj dom.buttonSearch is not Dom element, but jQuery object
thinsoldier
@thinsoldier
Oct 27 2017 01:17
@korzo could you point me to "modern web hosting in 2017 for dummies" kind of information because I keep seeing people saying "host it for a penny on Amazon" or similar but I look at digitalocean and amazon and google app engine and try to figure out how much they would cost and I fail miserably.
Adam Faraj
@adamfaraj
Oct 27 2017 01:18
@korzo should've used it as a class instead?
that would've worked, yeah?
korzo
@korzo
Oct 27 2017 01:20
@adamfaraj no. It would work if you use document.getElementById('button-search') instead of $('#button-search')
Kaz Baig
@kbaig
Oct 27 2017 01:20
@adamfaraj getElementById('a') is not the same as $('#a')
they achieve the same things but they're not the same thing in and of themselves
Long Nguyen
@longnt80
Oct 27 2017 01:23

@thinsoldier

The total cost of hosting your static website on AWS will vary depending on your usage. Typically, it will cost $1-3/month if you are outside the AWS Free Tier limits. If you qualify for AWS Free Tier and are within the limits, hosting your static website will cost around $0.50/month.

korzo
@korzo
Oct 27 2017 01:23
@thinsoldier You can host static HTML + assets on S3
http://docs.aws.amazon.com/AmazonS3/latest/dev/WebsiteHosting.html
Adam Faraj
@adamfaraj
Oct 27 2017 01:23
@kbaig oh shit. just taught me something man!
korzo
@korzo
Oct 27 2017 01:24
@thinsoldier and it cost $0.023 per GB
Kaz Baig
@kbaig
Oct 27 2017 01:25
@adamfaraj 2 diff APIs my dude
korzo
@korzo
Oct 27 2017 01:26
@thinsoldier digital Ocean is more VPS provider. Also you can take webhosting from any company for 2-3$ per month with unlimited domains and storage
thinsoldier
@thinsoldier
Oct 27 2017 01:27

Amazon S3 does not support server-side scripting.

That's my problem. 30+ projects that need php and nobody is going to pay me to port them to a static page builder and some won't work as purely static

Can you suggest a good hosting provider in the $3 per month price range? I know people who've tried a few over the last 5 years and there was always something catastrophic that went wrong.
Adam Faraj
@adamfaraj
Oct 27 2017 01:29
@kbaig thanks man
CamperBot
@camperbot
Oct 27 2017 01:29
adamfaraj sends brownie points to @kbaig :sparkles: :thumbsup: :sparkles:
:cookie: 386 | @kbaig |http://www.freecodecamp.com/kbaig
Kaz Baig
@kbaig
Oct 27 2017 01:29
@adamfaraj np
korzo
@korzo
Oct 27 2017 01:29
@thinsoldier as long as projects don't have 1000s of users per hour, you can host them on 1 account
I use Dreamhost. For 120$/year I host more then 200 apps
thinsoldier
@thinsoldier
Oct 27 2017 01:30
Yeah but that's the $10 range, not the $3 range.
I'm also currently on Dreamhost for personal stuff
korzo
@korzo
Oct 27 2017 01:31
@thinsoldier Hostmonster is 4$ something, Bluehost is cca 4$
@thinsoldier hostgator is also $4
I saw hosting companies with even lower prices, but I don't remember the names.
But i think it will be easy to find with some hosting comparison service
@thinsoldier Anyway, with these companies never rely on them, always have your own backup and be ready to move at any given time :)
Internet is full of horror stories
Kaz Baig
@kbaig
Oct 27 2017 01:36
hostgator charged me 60 bucks for hosting add-ons a month after i cancelled hosting
and is reluctant to refund me
i was with support for an hour today
and they were like...i can put in a request but dont be surprised if they refuse
their portal doesn't even let you cancel your hosting add-ons once you cancel hosting
korzo
@korzo
Oct 27 2017 01:41
@kbaig I have several similar stories from Hostgator and others. That's why I suggest to be ready to move.
One my client was offline for over a week without any help or feedback from them.
Kaz Baig
@kbaig
Oct 27 2017 01:43
@korzo why do you think I cancelled ;)
reason I was with them is because this basic html course I took in school made me
korzo
@korzo
Oct 27 2017 01:43
I use Dreamhost, because it's most reliable from mentioned above and it has SSH access. even support is not that bad, but I needed it only twice in 6 years.
Kaz Baig
@kbaig
Oct 27 2017 01:45
I just need something fast and reliable for a portfolio and some apps
so was gonna do aws when im ready
Joshua Waller
@Obscureether1
Oct 27 2017 01:45
Good evning everyone
could you all look at this and dive me your input... yes i know the images will not show as of yet...
Lee
@LeeConnelly12
Oct 27 2017 02:01

@Obscureether1 I like the layout you have going, also, you spelt Projects wrong in your navigation bar.

A nice idea might be when a user clicks the contact button it automatically scrolls down to your contact form.

Joshua Waller
@Obscureether1
Oct 27 2017 02:02
thanks for that spell check...lol
yea still not done with that as of tey got to do the finishing touches yet
thanks @LeeConnelly12
CamperBot
@camperbot
Oct 27 2017 02:02
obscureether1 sends brownie points to @leeconnelly12 :sparkles: :thumbsup: :sparkles:
:cookie: 155 | @leeconnelly12 |http://www.freecodecamp.com/leeconnelly12
Lee
@LeeConnelly12
Oct 27 2017 02:02
@Obscureether1 np
Joshua Waller
@Obscureether1
Oct 27 2017 02:03
mad found that imag just to add it so there was able to be something showing, and forgot to acctually download the image....
heroiczero
@heroiczero
Oct 27 2017 04:16
@Obscureether1 it is not responsive, but it is done well with CSS. :+1: nice job Keep going :)
Brittany Rutherford
@brittanyrutherford
Oct 27 2017 04:18
is it OK to change the font size of h1,h2, etc.. ?
Mujahid Alkausari
@Alkousari
Oct 27 2017 04:23

<style type="text/css">

.form-login-animation{
outline: 1px solid #e2cece;
padding: 48px 20px 5px 20px !important;
position: absolute !important;
top: 53px;
right: 115px;
width: 5%;
height: 26px !important;
overflow: hidden;
box-shadow: -3px 3px 7px -1px;
background: linear-gradient(90deg, red, green);
animation: animate1 2s infinite alternate ease;
}
@keyframes animate1{
from{
outline: 1px solid #e2cece;
padding: 48px 20px 5px 20px !important;
position: absolute !important;
top: 53px;
right: 115px;
width: 5%;
height: 26px !important;
overflow: hidden;
box-shadow: -3px 3px 7px -1px;
background: linear-gradient(0deg, red, green);
}
to{
outline: 1px solid #e2cece;
padding: 48px 20px 5px 20px !important;
position: absolute !important;
top: 257px;
right: 440px;
width: 35%;
height:400px !important;
overflow: hidden;
box-shadow: -3px 3px 7px -1px;
background: linear-gradient(90deg, red, green);
}
}
.form-control{
margin-bottom: 10px !important;
}
.navbar-margin{
margin-right: 2px;
}
</style>

<script>

$(function(){

$('.login').click(function(){
    $('.form-login-animation').show();
});

});

</script>
</head>

<body>

<div class="container">
<!-- Navbar -->
<nav class="navbar navbar-default">
<div class="navbar-header">
<a href="" class="navbar-brand">ABC</a>
</div>
<ul class="nav navbar-nav">
<li><a href="">XYZ</a></li>
<li><a href="">MNO</a></li>
<li><a href="">PQR</a></li>
<li><a href="">STU</a></li>
<li><a href="">UWX</a></li>
</ul>
<ul class="nav navbar-nav navbar-right navbar-margin">
<li><a href="#" class="signup"><span class="glyphicon glyphicon-user"></span> Sign Up</a></li>
<li><a href="#" class="login"><span class="glyphicon glyphicon-log-in"></span> Login</a></li>
</ul>
</nav>
<!-- Navbar End-->

<div class="row">
<div class="col-sm-2"></div>
<div class="col-sm-6">
<p>Click on Login or Logout button to see animation effect</p>
</div>
</div>
<div class="row">
<div class="col-sm-2"></div>
<div class="col-sm-6">
<h2>Jquery Simple Task Week3</h2>
</div>
</div>

<!-- Login Form -->
<div class="collapse form-login-animation">
    <form>
        <div class="form-group" align="center">
            <input type="text" name="email" class="form-control" placeholder="Email">
            <input type="password" name="password" class="form-control" placeholder="Password">
            <input class="btn btn-info" id="login" type="submit" name="submit" value="Login" class="form-control" >
        </div>
    </form>
</div>
<!-- Login Form End -->

</div>
</body>
</html>

During the animation hight does not apply...got stuck
Help neede, thanks
I know the code is too long but anyway go through with birld eye
Ashwin
@ashwins93
Oct 27 2017 04:28
@Alkousari can you upload to codepen and share the link here?
Mujahid Alkausari
@Alkousari
Oct 27 2017 04:30
Sure @ashwins93
Mujahid Alkausari
@Alkousari
Oct 27 2017 04:44
Hey @ashwins93 pastebin link is above, thanks
CamperBot
@camperbot
Oct 27 2017 04:45
alkousari sends brownie points to @ashwins93 :sparkles: :thumbsup: :sparkles:
:cookie: 396 | @ashwins93 |http://www.freecodecamp.com/ashwins93
Tiago Correia
@tiagocorreiaalmeida
Oct 27 2017 08:18
gm
alpox
@alpox
Oct 27 2017 08:23
@tiagocorreiaalmeida :wave:
@tiagocorreiaalmeida Pls tell me you have a question! I need some distraction from this math class :D
Tiago Correia
@tiagocorreiaalmeida
Oct 27 2017 08:23
ahahaha crap no
learned to use clip-path yesterday feel like im just gonna start drawing geometry figures on the websites :D
are you on the university?
alpox
@alpox
Oct 27 2017 08:26
@tiagocorreiaalmeida Yea i am. What's clip-path? :D
Oh i see. Never used that :D
Tiago Correia
@tiagocorreiaalmeida
Oct 27 2017 08:26
its a css proprety you can turn an image into a polygon :D
and learned aswell you can compress content using express and turn the request 70% faster
learned this on the morning while taking breakfast and using an app called <envi/> :D
alpox
@alpox
Oct 27 2017 08:27
@tiagocorreiaalmeida Nice :D always learning is good
I never heard of clip-path but when i need to draw stuff, i use the awesome D3.js :D
Tiago Correia
@tiagocorreiaalmeida
Oct 27 2017 08:32
gonna try to do some codewars got some solutions that time out even tough I guess success in everything maybe will need your opinion/help :DDD
alpox
@alpox
Oct 27 2017 08:33
Okay :D
Kietil
@Kietil
Oct 27 2017 08:38
I need a livereload for php files... how do i get it? atom-live-server does not refresh my php files... what do i do?
rohitdesigner
@rohitdesigner
Oct 27 2017 08:44
```@media screen and (max-width: 500px) {
.bhk{
width:100%;
height:20%;
}
.post{
height: 80%;
width: 100%;
}
}
@media  screen and (max-width: 500px) {
    .bhk{
        width:100%;
        height:20%;
    }
    .post{
        height: 80%;
        width: 100%;
    }
}
not working guys why
Tiago Correia
@tiagocorreiaalmeida
Oct 27 2017 08:51
in what size you have your screen?
this will only work to size screens below 500px
plus those % are based on the parent element
so take a close look to see if everything is going as planned
rohitdesigner
@rohitdesigner
Oct 27 2017 08:52
i am viewing in desktop
@tiagocorreiaalmeida
Tiago Correia
@tiagocorreiaalmeida
Oct 27 2017 08:52
resizing the window?
rohitdesigner
@rohitdesigner
Oct 27 2017 08:53
yes
@tiagocorreiaalmeida
Tiago Correia
@tiagocorreiaalmeida
Oct 27 2017 08:53
inspect the element and see if there are changes on the css when you go below 500px
rohitdesigner
@rohitdesigner
Oct 27 2017 08:53
ok
not working @tiagocorreiaalmeida
Tiago Correia
@tiagocorreiaalmeida
Oct 27 2017 08:55
can you upload your code int oa codepen?
rohitdesigner
@rohitdesigner
Oct 27 2017 08:55
ok wait
its working on codepen but not in chrome?
@tiagocorreiaalmeida
Tiago Correia
@tiagocorreiaalmeida
Oct 27 2017 08:57
have tyour files saved locally?
and linked on the html ?
rohitdesigner
@rohitdesigner
Oct 27 2017 08:58
yes
Tiago Correia
@tiagocorreiaalmeida
Oct 27 2017 08:58
can you print tyour html file and place it here?
rohitdesigner
@rohitdesigner
Oct 27 2017 08:59
<html>
    <head>
        <meta name="viewport" content="width=device-width, initial-scale=1.0">
        <style>
@media   only screen and (max-width: 500px) {
    .bhk{
        width:100%;
        height:20%;
    }
    .post{
        height: 80%;
        width: 100%;
    }
    body{
        background: red;
    }
}
        .ui.menu{
            height:55px;
        }
        .hidden{
            display: none;
        }
        .mobile.header{

            width:100%;
            display: flex;



        }
        p{
            background: red;
        }
        .pagemain{
            display:flex;
            flex-wrap: wrap;
width:100vw;
height:1300px;
border:1px solid red;
        }
        .bhk{
            height:200px;
            background: maroon;
            width: 25%;

        }
        .post{
            background: teal;
            height:100%;
            width:75%;

        }
        .mobile.brandname{
display:flex;
justify-content: center;
align-items: center;
width:80%;
        }
        .mobile.burger{
cursor: pointer;
align-self: flex-start;
height: 100%;
width: 20%;
display: flex;
justify-content: center;
align-items: center;
        }
        </style>
        <link rel="stylesheet" type="text/css" href="semantic/dist/semantic.min.css">
<script
  src="https://code.jquery.com/jquery-3.1.1.min.js"
  integrity="sha256-hVVnYaiADRTO2PzUGmuLJr8BLUSjGIZsDYGmIJLv2b8="
  crossorigin="anonymous"></script>
  <link rel="stylesheet" type="text/css" href="grid.css">
<script src="semantic/dist/semantic.min.js"></script>
<script src="./js/breakpoints.js"></script>
    </head>
    <body>
       <div class="ui left vertical menu sidebar" sidebar>
    <a class="item">
      Item 1
    </a>
    <a class="item">
      Item 2
    </a>
    <a class="item">
      Item 3
    </a>
       </div>
       <div class="pusher">
            <div class="ui menu" id="menu">
                <div class="mobile header" style="display: none">
                    <div class="mobile brandname">
<span class=" ui header ">Our Company</span>
                    </div>
                    <div class="mobile burger">
                <i class="sidebar icon"></i>        
                    </div>
                </div>
            <a class="header item " hidden >
                Our Company
            </a>
            <div class="item ui dropdown" id="menu" hidden>
                <div class="text" >Drop</div>
                <i class="dropdown icon"></i>
                <div class="menu" > 
                    <div class="item" >New Things Beby</div>
                </div>
            </div>
            <div class="item" id="menu" hidden>
                Another
            </div>
            <div class="right menu" id="menu" hidden>
                <div class="item borderless">
                    <button type="" class="ui button" style="color: white">Login</button>
                </div>
            </div>
        </div>


        <div class="pagemain">
            <div class="post"></div>
            <div class="bhk"></div>
        </div>

        <script>
$(document).ready(function() {
    $('.mobile.burger').on("click",function(){
        $("[sidebar]").sidebar("toggle");
    });

    // run test on initial page load
    checkSize();

    // run test on resize of the window
    $(window).resize(checkSize);
});
function checkSize(){
   if($(window).width() <= 500 ){
       console.log("added")
        $("[hidden]").css("display","none");
        $('.mobile.header').removeAttr("style");


   }
   if($(window).width() > 500 ){
       console.log("added")
       $("[sidebar]").sidebar("hide");
        $("[hidden]").removeAttr("style");
        $(".mobile.header").css("display","none");

   }
}

            $('.ui.dropdown')
  .dropdown(
      {
          on:'hover',
          duration:400
      }
  )
;

        </script>
       </div>
    </body>
</html>
@tiagocorreiaalmeida
Tiago Correia
@tiagocorreiaalmeida
Oct 27 2017 09:01
place the query below the rest of the csss tyling
rohitdesigner
@rohitdesigner
Oct 27 2017 09:01
ok lets see
why can u explain?
worked but why??
Tiago Correia
@tiagocorreiaalmeida
Oct 27 2017 09:03
cascading order
Lee
@LeeConnelly12
Oct 27 2017 09:03
morning everybody! :smile:
Tiago Correia
@tiagocorreiaalmeida
Oct 27 2017 09:03
since they both target the same way using a class then the code order decides what will run
cause one overwrite the other
Tiago Correia
@tiagocorreiaalmeida
Oct 27 2017 09:12
@alpox
function findOdd(A) {
  //happy coding!

  for(let i = 0; i < A.length; i++){
    let count = 0;
    for(let j=0; j < A.length;j++){
      if(A[i] === A[j]){
        count ++;
      }
    }
    if(count % 2 !== 0) return A[i];
  }
}
linkin-park
@linkin-park
Oct 27 2017 09:19
hi @tiagocorreiaalmeida
Tiago Correia
@tiagocorreiaalmeida
Oct 27 2017 09:20
hey, how are you?
linkin-park
@linkin-park
Oct 27 2017 09:21
@ashwins93 there?
@tiagocorreiaalmeida good
alpox
@alpox
Oct 27 2017 09:36
@tiagocorreiaalmeida
return A.reduce((c,i) => (c[i]=!c[i],c), []).findIndex(i=>i); :-)
Might not be the most performant, but probably quite short enough :D
linkin-park
@linkin-park
Oct 27 2017 09:37
js is never performant
alpox
@alpox
Oct 27 2017 09:38
@linkin-park It actually is. And as programmer one has to care about performance too, in some cases
Kietil
@Kietil
Oct 27 2017 09:38
I need a livereload for php files... how do i get it? atom-live-server does not refresh my php files... what do i do?
alpox
@alpox
Oct 27 2017 09:39
@Kietil Maybe there is a configuration problem?
linkin-park @linkin-park opens a chunk load of papers from the past
Kietil
@Kietil
Oct 27 2017 09:39
@alpox could be.. should live atom server reload php files ?
alpox
@alpox
Oct 27 2017 09:40
@Kietil idk, i never used it
Shouldn't it be language independant?
@Kietil Hmm when i look at it, it seems to work only on html and maybe resource files
@Kietil Maybe you can try https://github.com/napcs/node-livereload
Kietil
@Kietil
Oct 27 2017 09:46
@alpox thanks, i can try that... to bad there is no easier solution, because the Brackets editor has this function. Why not Atom
CamperBot
@camperbot
Oct 27 2017 09:46
kietil sends brownie points to @alpox :sparkles: :thumbsup: :sparkles:
:star2: 1408 | @alpox |http://www.freecodecamp.com/alpox
Lee
@LeeConnelly12
Oct 27 2017 10:07

Can the logical or operator be used as an undefined coalescing operator?
for example,

this.eventCategory = event.category || 'Annual Leave';

if event cateogry is undefined I want event this.eventCategory to be set the value of 'Annual leave'

korzo
@korzo
Oct 27 2017 10:27
@LeeConnelly12 yes. It's very common
You often see in the code
something = somethingOther || {};
But it evaluates as falsy, not just undefined
Lee
@LeeConnelly12
Oct 27 2017 10:35
@korzo I'm stuck on a little issue with using the operator.

@korzo I have an object called event.

the event has a boolean property called allDay on it.
I want to do something like

this.eventAllDay = event.allDay || 'Annual Leave';

I get a null reference exception because allDay does not exist on event, because event is null.
the only workaround I can think of is

if (event !== null) {
     this.eventAllDay = event.allDay;
}

but I find it messy.

korzo
@korzo
Oct 27 2017 10:41
@LeeConnelly12 you can turn it into ternary
this.eventAllDay = event && event.allDay ? event.allDay : 'Annual Leave';
@LeeConnelly12
also this should work
this.eventAllDay = event && event.allDay || 'Annual Leave';
@LeeConnelly12
Lee
@LeeConnelly12
Oct 27 2017 10:50
@korzo that makes sense, thanks
CamperBot
@camperbot
Oct 27 2017 10:50
leeconnelly12 sends brownie points to @korzo :sparkles: :thumbsup: :sparkles:
:cookie: 684 | @korzo |http://www.freecodecamp.com/korzo
Lee
@LeeConnelly12
Oct 27 2017 11:16

I have an array of hours I used to insert into a select element as a string:

const hoursArray: string = ['1 AM', '2 AM', '3 AM', '4 AM']
.map(x => `<option value='${x}'>${x}</option>`).join('');

I would like to increment the element's option value for each element like

.map(x, i) => `<option value='${i}'>${x}</option>`).join('');

How would I do this?

DavidR
@davidrinconv
Oct 27 2017 11:20
tes
`array1 = [{a : 1, b: 2, c:3}, {a: 2, b: 3, c: 4}]
DavidR
@davidrinconv
Oct 27 2017 11:27
array1 = [{a : 1, b: 2, c:3}, {a: 2, b: 3, c: 4}] array2=[{a]
Stephen James
@sjames1958gm
Oct 27 2017 11:55
@LeeConnelly12 you need .map((x, i) =>
Pascal Clanget
@Gh05d
Oct 27 2017 12:00
Hey gals, if I want to tell node to render a component using react, can I specify it like this?
app.engine('react', );
app.set('view engine', 'react')
Ashwin
@ashwins93
Oct 27 2017 12:55
@Gh05d checkout express-react-views
Then you can render jsx
Pascal Clanget
@Gh05d
Oct 27 2017 13:15
@ashwins93 thx :thumbsup: but I already switched to another solution
Ashwin
@ashwins93
Oct 27 2017 13:15
@Gh05d which is?
Pascal Clanget
@Gh05d
Oct 27 2017 13:16
going back to seperate server and view and run both at the same time with concurrently
all still to get the f''# email form on the portfolio page working ^^
Ashwin
@ashwins93
Oct 27 2017 13:20
lol
but once you are done developing your frontend, you can bundle them into static files
and serve them with express
Pascal Clanget
@Gh05d
Oct 27 2017 13:21
Well, I already deployed the full site.
gh05d.de
Ashwin
@ashwins93
Oct 27 2017 13:21
without bundling?
Pascal Clanget
@Gh05d
Oct 27 2017 13:21
I used the build command
and deployed the build folder this created.
I guess that bundled all the necessary stuff
and uglified and minified it.
Ashwin
@ashwins93
Oct 27 2017 13:22
Yeah thats what i meant
Pascal Clanget
@Gh05d
Oct 27 2017 13:56
It finally fucking works :D :sparkles: Yipi Ai yay Mothaf*a :smile:
Ashwin
@ashwins93
Oct 27 2017 13:57
lol
good work
Pascal Clanget
@Gh05d
Oct 27 2017 14:01
Ahem, how do I get my server to send a response?
Stupid question, I know
Ashwin
@ashwins93
Oct 27 2017 14:08
@Gh05d Response to a get request?
if you are receiving requests why cant you send responses?
Pascal Clanget
@Gh05d
Oct 27 2017 14:08
no, to a post request
My contact form sends the post request, but always gets an empty response
I posted the code here https://codepen.io/Gh05d/pen/EwBMPL
Ashwin
@ashwins93
Oct 27 2017 14:13
@Gh05d did you post your backend code to codepen
codepen is just frontend
Pascal Clanget
@Gh05d
Oct 27 2017 14:14
yeah, but I just wanted to show the whole code and did not want to post everything here.
Ashwin
@ashwins93
Oct 27 2017 14:14
okay you are using it to share
i got it
lol its strange
when it said "Please enable JS"
Pascal Clanget
@Gh05d
Oct 27 2017 14:15
Ah, yeah that is because I had the front-end react code in there before.
I always use this in the root div, in case the user has no javascript active
Ashwin
@ashwins93
Oct 27 2017 14:16
okay but in this code there i no res.write() or res.send()
wait wait
yeah did you try res.send()
Pascal Clanget
@Gh05d
Oct 27 2017 14:17
no, because this is more or less my first attempt at servers and I have no f*ng clue what I am doing ^^
Ashwin
@ashwins93
Oct 27 2017 14:18
lol okay then you should go through the learnyounode and expressworks
try the backend challenges at FCC
you need to send a response with res.send() method
Pascal Clanget
@Gh05d
Oct 27 2017 14:19
Yes, I plan to learn node when I finished the data visualization challenges
Pascal Clanget
@Gh05d
Oct 27 2017 14:25
It works, thx :thumbsup: @ashwins93
CamperBot
@camperbot
Oct 27 2017 14:25
gh05d sends brownie points to @ashwins93 :sparkles: :thumbsup: :sparkles:
:cookie: 397 | @ashwins93 |http://www.freecodecamp.com/ashwins93
Ashwin
@ashwins93
Oct 27 2017 14:26
@Gh05d :+1:
Jessie Cryer
@j-cryer
Oct 27 2017 14:31
whats up whats up whats up
who here knows something about Date type for MySql or Sql
Ken Haduch
@khaduch
Oct 27 2017 14:40
@j-cryer - put your question here and see if we can help you!
Giancarlos C.
@GianCastle
Oct 27 2017 14:45
Guys, how can i get the scroll percentage needed in order to get the container in viewport?
Ken Haduch
@khaduch
Oct 27 2017 14:52
@GianCastle - a quick search for your question gave this link on stackoverflow see if it helps you?
Giancarlos C.
@GianCastle
Oct 27 2017 15:02
I saw that answer before, however this can help just a bit. Anyway, thank you @khaduch.
CamperBot
@camperbot
Oct 27 2017 15:02
giancastle sends brownie points to @khaduch :sparkles: :thumbsup: :sparkles:
:star2: 3417 | @khaduch |http://www.freecodecamp.com/khaduch
linkin-park
@linkin-park
Oct 27 2017 15:03
hello @ashwins93
Ashwin
@ashwins93
Oct 27 2017 15:04
yeah hello @linkin-park
i'm about to leave now though
linkin-park
@linkin-park
Oct 27 2017 15:04
wait
Ashwin
@ashwins93
Oct 27 2017 15:04
its supper time here man
tell me quickly
linkin-park
@linkin-park
Oct 27 2017 15:05
wait
okay you can go now
linkin-park
@linkin-park
Oct 27 2017 15:10
:P
Matt Andrade
@andrade1379
Oct 27 2017 15:39

Guys I’m looking to split then splice a URL to insert a string then join but I need it to be after index 6 and before ?

http://local.mysite.com/api/blah/blah/fb85714c-a7e9-4b0a-ad2b-f234533b24b8 ? language=en

Want it to be:

http://local.mysite.com/api/blah/blah/fb85714c-a7e9-4b0a-ad2b-f234533b24b8/STRING?language=en
Matt Andrade
@andrade1379
Oct 27 2017 15:54
Figured it out:
path = http://local.mysite.com/api/blah/blah/fb85714c-a7e9-4b0a-ad2b-f234533b24b8?language=en
split = path.split('?');
split.splice(1, 0, ‘/STRING?');
url = split.join('');
Pascal Clanget
@Gh05d
Oct 27 2017 15:55
Anyone here familiar with animejs?
I want to fly a form out of the window when the user submits (that works) and a new div in from that direction with a message (that doesn't work right now). I am trying a timeline:
  animateSubmit() {
    const timeline = anime.timeline({});
    timeline.add({
      targets: "#contact",
      translateX: { value: -500, duration: 2000 },
      complete: () => {
        this.setState({ formSent: true });
      }
    });

    timeline.add({
      targets: "#sent",
      translateX: { value: 500, duration: 2000 },
      offset: "=-1000"
    });
  }
DavidR
@davidrinconv
Oct 27 2017 16:03
Hey guys just finished a little project that took about 5 days to put together whilst learning React and hitting my head with JS it would be awesome if you could check it out and let me know any feedback :) https://davidrinconv.github.io/cryptochart/
Pascal Clanget
@Gh05d
Oct 27 2017 16:10
@davidrinconv Looks good :thumbsup:
And it was nice to check the price from my bitcoins :smile:
DavidR
@davidrinconv
Oct 27 2017 16:22
hahha @Gh05d that is the only thing going up these days :)
Pascal Clanget
@Gh05d
Oct 27 2017 16:23
to the moon :money_with_wings:
Sorin Ruse
@sorinr
Oct 27 2017 16:37
@andrade1379 i suppose you wont that string as a variable. in that case u need:
split.splice(1, 0, '/'+mystring+'?');
Matt Andrade
@andrade1379
Oct 27 2017 16:51
@sorinr thanks
Sorin Ruse
@sorinr
Oct 27 2017 16:57
@andrade1379 welcome
Jose Diaz
@jsd540
Oct 27 2017 17:34
I finally finished the twitch api challenge, Please give me any constructive critici
Tour Anywhere
@sulembut3
Oct 27 2017 17:34
skoðaðu þetta http://touranywhere.tk
Kaz Baig
@kbaig
Oct 27 2017 17:36
@jsd540 were you looking for design or code feedback
Pascal Clanget
@Gh05d
Oct 27 2017 17:36
@jsd540 why do you have two scrollbars? I would remove the inner one, as it doesn't seem to do anything anyway and change On-line and Off-line to Online and Offline. Looks weird otherwise.
Jose Diaz
@jsd540
Oct 27 2017 17:41
@kbaig both
@Gh05d thanks it does look weird , there should only be 1 scroll on the inner though, is there something I need to add to css?
CamperBot
@camperbot
Oct 27 2017 17:43
jsd540 sends brownie points to @gh05d :sparkles: :thumbsup: :sparkles:
:cookie: 297 | @gh05d |http://www.freecodecamp.com/gh05d
Lee
@LeeConnelly12
Oct 27 2017 17:45
@jsd540 overflow-y: hidden
Jose Diaz
@jsd540
Oct 27 2017 17:46
@LeeConnelly12 is that on the body?
Kaz Baig
@kbaig
Oct 27 2017 17:46
@jsd540 html:
  • You don't need to include html, head, and body tags on codepen. Codepen assumes all your code is in the body. If you want to put something in the head, inset it via the textbox in the html settings.
  • link and meta tags go in the head, not outside of it in the html. Script can go in either head or body.
  • button tags already have a default type of button so you don't need to include it
  • You almost never need to use br tags. You should probably be accomplishing this via margins in your css
Lee
@LeeConnelly12
Oct 27 2017 17:46
@jsd540 add the property to your div.streamers element
@jsd540 actually, remove overflow: scroll from your #stream_display element
@jsd540 looks nicer]
Pascal Clanget
@Gh05d
Oct 27 2017 17:49
@jsd540 try adding overflow: hidden; to streamers
Lee
@LeeConnelly12
Oct 27 2017 17:49
@jsd540 and add overflow-x:hidden to your div.streamers element to remove that horizontal scroll, since you're only going to scroll up and down.
Pascal Clanget
@Gh05d
Oct 27 2017 17:50
@LeeConnelly12 oops, you were quicker :smile:
Lee
@LeeConnelly12
Oct 27 2017 17:50
@Gh05d hiding the overflow-y on the streamers element makes it unscrollable
Chris
@bestintown23
Oct 27 2017 17:51
why is my handshake picture not touching the left edge like the bullseye photo? https://codepen.io/bestintown23/pen/aVbzoj
Lee
@LeeConnelly12
Oct 27 2017 17:51
@Gh05d Yeah, im pretty bored atm, working on my portfolio and answering questions here as well.
A-J Roos
@Asjas
Oct 27 2017 17:52
Hey guys. Can someone assist me with a problem with my website? Something is causing the width to be more than 100vw and I have a slider at the bottom of my page. I've been staring at this for an hour and I'm about to hit my head on the desk. Here is a link to my codepen https://codepen.io/asjas/pen/ooNNKm
Kaz Baig
@kbaig
Oct 27 2017 17:54
@jsd540 style:
  • spacing looks fine on full page mode but the margins are a bit too high if you make the screen a bit narrower
  • consider moving the stream'er's pic to be inline with their name, allowing for alignment of the image with the name and simultaneously creating more space for the < p id='stats'</p>
  • Consider changing font-weights/colors/background colors/borders around to improve contrast between different elements
  • I'd add a border and potentially slight box-shadow to the profile pics. Maybe same to the offline/online icons as they have a slight white border around them right now which you could want to mask a little
  • As others have mentioned, you should remove the inner vertical scrollbar and the horizontal scrollbar as well. It also looks like the outer scrollbar is spilling outside of the box, you should try spacing that differently
Jose Diaz
@jsd540
Oct 27 2017 17:55
@LeeConnelly12 @Gh05d just made the changes thanks guys.
CamperBot
@camperbot
Oct 27 2017 17:55
jsd540 sends brownie points to @leeconnelly12 and @gh05d :sparkles: :thumbsup: :sparkles:
api offline
:cookie: 157 | @leeconnelly12 |http://www.freecodecamp.com/leeconnelly12
Lee
@LeeConnelly12
Oct 27 2017 17:55
@Asjas add overflow-x: hidden; to your body to remove the horizontal scroll bar
A-J Roos
@Asjas
Oct 27 2017 17:56
head == desk
@leeConnelly12 Thank you so much. It's working
Mostafa Hesham
@mhesham32
Oct 27 2017 17:57
hello guys i want the parameter to be an array for every single number
fun(123){
//need to get [1 , 2,3]
}
Lee
@LeeConnelly12
Oct 27 2017 17:57
@Asjas <h1>No problem</h1>
aww
Kaz Baig
@kbaig
Oct 27 2017 17:59
@mhesham32 look at the toString and split functions
Mostafa Hesham
@mhesham32
Oct 27 2017 18:00
@kbaig but it will give
['1','2','3']
Lee
@LeeConnelly12
Oct 27 2017 18:05
@mhesham32
fun = (number) => {
return (number+'').split``
}

fun (123) // returns [1, 2 , 3]
Kaz Baig
@kbaig
Oct 27 2017 18:05
@mhesham32 is that not what you want
oh you want numbers
Mostafa Hesham
@mhesham32
Oct 27 2017 18:05

@kbaig it will be

["123"]

actually

Kaz Baig
@kbaig
Oct 27 2017 18:06
it will be ['1', '2', '3'], which you could map with the number function
Lee
@LeeConnelly12
Oct 27 2017 18:06
@mhesham32 The function above will give you [1, 2, 3]
Kaz Baig
@kbaig
Oct 27 2017 18:06
@LeeConnelly12 that will still do ['1', '2', '3']
Lee
@LeeConnelly12
Oct 27 2017 18:07
@kbaig Isn't that what he wants?
Mostafa Hesham
@mhesham32
Oct 27 2017 18:07
@LeeConnelly12 it still ["1", "2", "3"]
Kaz Baig
@kbaig
Oct 27 2017 18:07
he wants them to be numbers, not strings
Lee
@LeeConnelly12
Oct 27 2017 18:07
oh
@mhesham32
fun = (number) => {
return (number+'').split``.map(x => x/1) // [1, 2 , 3]
}
Kaz Baig
@kbaig
Oct 27 2017 18:07
arg.toString().split('').map(n => Number(n))
Lee
@LeeConnelly12
Oct 27 2017 18:07
@mhesham32 There you go
dividing a string by 1 will convert it to an integer
Kaz Baig
@kbaig
Oct 27 2017 18:08
that's so hacky
Lee
@LeeConnelly12
Oct 27 2017 18:08
not really
Mostafa Hesham
@mhesham32
Oct 27 2017 18:08
@LeeConnelly12 it works thanks
CamperBot
@camperbot
Oct 27 2017 18:08
mhesham32 sends brownie points to @leeconnelly12 :sparkles: :thumbsup: :sparkles:
:cookie: 158 | @leeconnelly12 |http://www.freecodecamp.com/leeconnelly12
Jose Diaz
@jsd540
Oct 27 2017 18:08
@LeeConnelly12 Just made the change to the body. Thanks
CamperBot
@camperbot
Oct 27 2017 18:08
jsd540 sends brownie points to @leeconnelly12 :sparkles: :thumbsup: :sparkles:
api offline
Mostafa Hesham
@mhesham32
Oct 27 2017 18:10
i figured it out javascript deals with string numbers like numbers when math is done is that right? @LeeConnelly12
Kaz Baig
@kbaig
Oct 27 2017 18:10
it does but you gotta be careful with that stuff
Lee
@LeeConnelly12
Oct 27 2017 18:11
@mhesham32 Yeah
Mostafa Hesham
@mhesham32
Oct 27 2017 18:11
it is weird actually
Lee
@LeeConnelly12
Oct 27 2017 18:13
yeah stuff like this works
'2' * 2 // 4
Ashwin
@ashwins93
Oct 27 2017 18:13
@mhesham32 it's actually in the official ecma specification. The ToNumber coercion. It's in the section 9.3 I guess
Or you could read about it in YDKJS
book 4 chapter 4
Isaiah Trembley
@IsaiahCT
Oct 27 2017 18:14
@ashwins93 what is that
Ashwin
@ashwins93
Oct 27 2017 18:14
@IsaiahCT what is what ? Lol
Mostafa Hesham
@mhesham32
Oct 27 2017 18:14
@ashwins93 that is so nerdy :smile:
Isaiah Trembley
@IsaiahCT
Oct 27 2017 18:14
YDKJS
Ashwin
@ashwins93
Oct 27 2017 18:15
@mhesham32 lol yeah but knowing stuff like that can save you sometimes ( I meant knowing about the ToNumber not section numbers lol)
@IsaiahCT it's an amazing book. Check it out once you get some experience in JS
Mostafa Hesham
@mhesham32
Oct 27 2017 18:16
sure thing thank you guys
mbpiner
@mbpiner
Oct 27 2017 19:34
Hey guys, trying to access a certain object in a JSON for the wiki search project
For example, this is the URL which I'm trying to get this right with
It's a search for the term "philosophy" with callback=? at the end to request the JSON and JSONP
&action=query&generator=search&gsrnamespace=0&gsrlimit=10&prop=pageimages|extracts&pilimit=max&exintro&explaintext&exsentences=1&exlimit=max&gsrsearch=philosophy&callback=?
is good for looking at it in an easier to read format
my problem is I have to get to the data which is at jsonData["query"]["pages"]
Kaz Baig
@kbaig
Oct 27 2017 19:39
@mbpiner can you link the api call you're making or a pen
mbpiner
@mbpiner
Oct 27 2017 19:39
Oops, sorry thought above was
Kaz Baig
@kbaig
Oct 27 2017 19:39
full call
mbpiner
@mbpiner
Oct 27 2017 19:40
at jsonData["query"]["pages"], the next element I have to select by to get further in the object is a random ass number
and jsonData["query"]["pages"][0] returns undefined so I cant call it by that
is there a jquery method or some library or something I can use to just return the first child, that would function similarly to jsonData["query"]["pages"][0]?
mbpiner
@mbpiner
Oct 27 2017 19:43
I've googled around but i've realized after you and alpox helping me its a lot quicker just to ask someone who knows
Kaz Baig
@kbaig
Oct 27 2017 19:43
and then iterate/map over the array
mbpiner
@mbpiner
Oct 27 2017 19:43
Shoot that's right! Totally forgot about Object.keys()
Kaz Baig
@kbaig
Oct 27 2017 19:44
Honestly, it should really be an array they give us
But it's fine
quickspeedy
@quickspeedy
Oct 27 2017 19:44
How do I center the weather box including search bar? I tried using height: 100vh; and it don't work. I tried rearranging positioning but it makes the weather box and searchbar out of place.
Codepen: https://codepen.io/quickspeedy/pen/BmBWoQ
Kaz Baig
@kbaig
Oct 27 2017 19:44
@quickspeedy vertical and horizontal you mean?
quickspeedy
@quickspeedy
Oct 27 2017 19:45
vertical center
@kbaig
Kaz Baig
@kbaig
Oct 27 2017 19:46
@quickspeedy here you go
.centerSection {
  height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}
mbpiner
@mbpiner
Oct 27 2017 19:46
You could get it further down with margin-top:
quickspeedy
@quickspeedy
Oct 27 2017 19:46
Was it necessary to include flex? @kbaig
mbpiner
@mbpiner
Oct 27 2017 19:47
@kbaig thank you btw
CamperBot
@camperbot
Oct 27 2017 19:47
mbpiner sends brownie points to @kbaig :sparkles: :thumbsup: :sparkles:
:cookie: 387 | @kbaig |http://www.freecodecamp.com/kbaig
Kaz Baig
@kbaig
Oct 27 2017 19:47
i mean you could do it using transform: translate and position: relative but why bother
quickspeedy
@quickspeedy
Oct 27 2017 19:47
@kbaig Ok all right thanks!
CamperBot
@camperbot
Oct 27 2017 19:47
quickspeedy sends brownie points to @kbaig :sparkles: :thumbsup: :sparkles:
:cookie: 388 | @kbaig |http://www.freecodecamp.com/kbaig
Kaz Baig
@kbaig
Oct 27 2017 19:48
np friendos
@quickspeedy would prob look better if you did 75vh instead of 100 btw
quickspeedy
@quickspeedy
Oct 27 2017 19:52
@kbaig Now that you mentioned it, it actually does look better.
Thanks again!
Kaz Baig
@kbaig
Oct 27 2017 19:53
@quickspeedy no prob, exact vertical center is not something human eyes like, even though we intuitively think they would
quickspeedy
@quickspeedy
Oct 27 2017 20:02
@kbaig Yeah that is true. Something I can learn for UI design.
quickspeedy
@quickspeedy
Oct 27 2017 21:26

After trying to call the api when a user type in the location, I get this error:

Failed to load https://autocomplete.wunderground.com/aq?query=San%20F&c=US: No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'https://s.codepen.io' is therefore not allowed access.

Anyone know how to solve this?

Here is the link to codepen: https://codepen.io/quickspeedy/pen/BmBWoQ
DennisLoska
@DennisLoska
Oct 27 2017 21:29
Cross site scripting is not allowed, therefore you get this error, you can solve this by using specific service providers, who try to get around that. Normally the backend of your site is requesting data from other servers, and then sends it to the client, so basically the browser/client only talks to your server. What you are trying to do is to make him talk with the API of wunderground at the same time, which because of security is not allowed.
if you have a server create an ajax request to your own php/nodejs/rails whatever backend, where you then make the api request, after processing the request send it back to your client
quickspeedy
@quickspeedy
Oct 27 2017 21:33
Never tried using node js. I'll look further in how to create an ajax request then. Thanks @DennisLoska
CamperBot
@camperbot
Oct 27 2017 21:33
quickspeedy sends brownie points to @dennisloska :sparkles: :thumbsup: :sparkles:
:cookie: 187 | @dennisloska |http://www.freecodecamp.com/dennisloska
DennisLoska
@DennisLoska
Oct 27 2017 21:35
well its pretty much the same you did already, but instead of the api-request in the URL you would type the path to your script for example /server/getWeather.php <-- API request will be done here
DennisLoska
@DennisLoska
Oct 27 2017 21:41
@quickspeedy here is a bit of code I did some months a go for the quote mashine, the request works without a server - XSS still of course won't work but I found a hacky way around it by reloading the whole page, so that it works on hosts where I cant setup a server like github pages
var main = document.getElementsByTagName("main")[0];

/*
 * Method not used but works, if forismatic would enable CORS-compatibility :(
 */

/*
function getQuote() {
    var xhttp = new XMLHttpRequest();
    xhttp.open("POST",
        "https://api.forismatic.com/api/1.0/?method=getQuote&key=457653&format=json&lang=en",
        true);
    if ('withCredentials' in xhttp) {
        xhttp.onreadystatechange = function () {
            if (this.readyState == 4 && this.status ==
                200) {
                var quote = JSON.parse(this.responseText);
                document.getElementById("quoteField").innerHTML = quote.quoteText + "</br></br>" +
                    quote.quoteAuthor;
            } else {
                document.getElementById("quoteField").innerHTML =
                    "Sorry, something went wrong there." + "</br></br>" + "Dennis, Web-Rookie"
            }
        };
        xhttp.send();
    }
}
*/
//dynamically loads in a new script-tag, when the quote-button is clicked
function createJSONPScriptTag() {
    //This does not work for some reason with THIS API, so I have to reload the page...
    /*
    var script_element = document.createElement('script'),
        url = "https://quotesondesign.com/wp-json/posts?filter[orderby]=rand&filter[posts_per_page]=1&_jsonp=parseQuote"
    script_element.setAttribute('src', url);
    document.head.appendChild(script_element);
    */
    location.reload();
}
https://dennisloska.github.io/QuoteMashine/
the first function is XSS-way and won't work, the second function works but is of course horrible when it comes to performance, but still better than having to buy a server I guess if you want it to work on github
you could try to make something similiar with your weatherApp
quickspeedy
@quickspeedy
Oct 27 2017 21:44
Ok thanks for the advice!
DennisLoska
@DennisLoska
Oct 27 2017 21:45
 var script_element = document.createElement('script'),
        url = "https://quotesondesign.com/wp-json/posts?filter[orderby]=rand&filter[posts_per_page]=1&_jsonp=parseQuote"
    script_element.setAttribute('src', url);
    document.head.appendChild(script_element);

    location.reload();
try to hack it somehow like this maybe it will work :smile:
quickspeedy
@quickspeedy
Oct 27 2017 21:53
Ok I'll try it. Thanks @DennisLoska
CamperBot
@camperbot
Oct 27 2017 21:53
quickspeedy sends brownie points to @dennisloska :sparkles: :thumbsup: :sparkles:
api offline
korzo
@korzo
Oct 27 2017 22:04
@DennisLoska What's the point of location.reload() ?
DennisLoska
@DennisLoska
Oct 27 2017 22:08
@korzo if I remember correctly this will reload the page , yes the whole page so it is realy bad actually as I said and I would only use it if you can't effort to host your own stuff
since the project was a random quote mashine i needed to reload the whole page for a new quote
but if you realy only need to make 1 request you dont have to reload the whole page. When you have to do many requests you have a big problem anyway :smile:
korzo
@korzo
Oct 27 2017 22:44
@DennisLoska yeah, I was trying to decipher, why you reload the page after you append the script :)
why you didn't use JSONP?
alpox
@alpox
Oct 27 2017 22:46
@korzo i think this was an attemt to use jsonp. Just only followed the way half through :D
korzo
@korzo
Oct 27 2017 22:48
@alpox I ask before jsonp works as long as you disable location.reload()
mbpiner
@mbpiner
Oct 27 2017 22:49
@alpox Hows it going man? I've got a question about the wiki project
DennisLoska
@DennisLoska
Oct 27 2017 22:49
first time hearing of it - yeah use JSONP if this is the actual way to go
Lee
@LeeConnelly12
Oct 27 2017 23:16

How do I tell a function in one of my js scripts to wait until another js script has finished loading?

relying on the order of the script tags in my html seems...Careless?

korzo
@korzo
Oct 27 2017 23:28
@LeeConnelly12 As long as you don't add async of defer attribute, script tags are loaded in the order they are in html
Lee
@LeeConnelly12
Oct 27 2017 23:31
@korzo ok ty
CamperBot
@camperbot
Oct 27 2017 23:31
leeconnelly12 sends brownie points to @korzo :sparkles: :thumbsup: :sparkles:
:cookie: 686 | @korzo |http://www.freecodecamp.com/korzo