These are chat archives for FreeCodeCamp/HelpFrontEnd

12th
Sep 2017
Tyler Del Rosario
@TylerDelRosario
Sep 12 2017 00:51

String.prototype.toJadenCase = function () {
//...

String = String.split("");
for (var i = 0; i <= str.length; i++) {

String[i].toLowerCase();

String[i].charAt(0).toUpperCase();

}

return String;
};

This is returning String.split(""); is not a function
Why?

``
String.prototype.toJadenCase = function () {
//...

String = String.split("");
for (var i = 0; i <= str.length; i++) {

String[i].toLowerCase();

String[i].charAt(0).toUpperCase();

}

return String;
};
``
This is returning String.split(""); is not a function
Could anyone help me on this? Thank you ahead of time ^^

:/
korzo
@korzo
Sep 12 2017 01:03
@HTMLNoob split is method of instance
You can call this.split or String.prototype.split
Tyler Del Rosario
@TylerDelRosario
Sep 12 2017 01:07
thank you I need to learn .prototype and this
korzo
@korzo
Sep 12 2017 01:13
@HTMLNoob I think you wanted this
String.prototype.toJadenCase = function() {    
    return this.charAt(0).toUpperCase() + this.slice(1).toLowerCase();
}
Tyler Del Rosario
@TylerDelRosario
Sep 12 2017 01:16
@korzo thank you!
CamperBot
@camperbot
Sep 12 2017 01:16
htmlnoob sends brownie points to @korzo :sparkles: :thumbsup: :sparkles:
:cookie: 476 | @korzo |http://www.freecodecamp.com/korzo
korzo
@korzo
Sep 12 2017 01:16
@HTMLNoob Glad to help
john94
@lpy1994
Sep 12 2017 01:19
I have a question guys, would you be able to find a entry web dev job with FCC full stack certificate?
_
Ismail Hozain
@ismailhozain
Sep 12 2017 01:20
i know tons of people who have gotten one but give it a try you have nothing to lose
piteto
@piteto
Sep 12 2017 01:20
@lpy1994 People have done that before, yes
john94
@lpy1994
Sep 12 2017 01:21
wow, those guys are amazing
I'll try to finish the full stack certificate and lets see what i can do with it. thanks for the link @piteto
CamperBot
@camperbot
Sep 12 2017 01:22
lpy1994 sends brownie points to @piteto :sparkles: :thumbsup: :sparkles:
:cookie: 95 | @piteto |http://www.freecodecamp.com/piteto
piteto
@piteto
Sep 12 2017 01:23
Have fun - I'm working on it too
Ismail Hozain
@ismailhozain
Sep 12 2017 01:26
me too
Long Nguyen
@longnt80
Sep 12 2017 01:46

@lpy1994

I have a question guys, would you be able to find a entry web dev job with FCC full stack certificate?

I'd say don't aim for full stack
Maybe you can try full stack in FCC to see which part you like best (frontend, backend). But to get a job, you should focus in one area.

john94
@lpy1994
Sep 12 2017 02:18
@longnt80 I get it, I am thinking finsih up with full stack certificate and to look for a entry level job first and then which end is better suits for me.
Zachary Orona-Calvert
@TheTRUEHoohah
Sep 12 2017 02:40

@TheTRUEHoohah
hey guys i have this js code for a pon game and i want add a sound byte to this if statement if (playerBScore >= 2 && playerBScore > playerAScore ){

   alert("Player 2 Wins");
  document.getElementById('sound').play();
  playerBScore = 0;
    playerAScore = 0;
 }                                                                                                                                                                                              

i already have the file linked <audio id="sound" src="https://www.dropbox.com/s/0xdugr2bv2ouaef/mkd_fight.wav?dl=0" preload="auto">
</audio>
whats wrong

Long Nguyen
@longnt80
Sep 12 2017 02:59
@TheTRUEHoohah is that the correct audio tag format?
Zachary Orona-Calvert
@TheTRUEHoohah
Sep 12 2017 03:00
already fixed my problem @longnt80 . the dropbox server doesnt allow it to be used as an API
Long Nguyen
@longnt80
Sep 12 2017 03:00
@TheTRUEHoohah :+1:
Zachary Orona-Calvert
@TheTRUEHoohah
Sep 12 2017 03:30
Mercy Manrique
@mers89
Sep 12 2017 03:31
thanks @coymeetsworld :)
CamperBot
@camperbot
Sep 12 2017 03:31
mers89 sends brownie points to @coymeetsworld :sparkles: :thumbsup: :sparkles:
:star2: 3002 | @coymeetsworld |http://www.freecodecamp.com/coymeetsworld
Coy Sanders
@coymeetsworld
Sep 12 2017 03:32
yw @mers89 :thumbsup:
nerkartushar8
@nerkartushar8
Sep 12 2017 03:57
Hi Guys, my lite-server is not reading my bs-config
Please help
Rafael Monroy
@rafaelmonroy
Sep 12 2017 04:43
hey guys, can anyone help me with my code

function spinalCase(str) {
  str = str.split('');
  for (i=0;i<str.length;i++){

    if (str[i] === str[i].toUpperCase() && i > 0){
      str[i] = ' ' + str[i];
    } 
  }
  str = str.join('').toLowerCase();
  return str.replace(/[\W_]/g, '-');
}

spinalCase('AllThe-small Things');
it returns all-the—small—things
its returning extra -’s
piteto
@piteto
Sep 12 2017 04:45
you could replace -- with - after your for loop
.replace(/-{1,}/g, '-');
Rafael Monroy
@rafaelmonroy
Sep 12 2017 04:47
@piteto oh cool, that worked, thanks!
CamperBot
@camperbot
Sep 12 2017 04:47
rafaelmonroy sends brownie points to @piteto :sparkles: :thumbsup: :sparkles:
:cookie: 96 | @piteto |http://www.freecodecamp.com/piteto
piteto
@piteto
Sep 12 2017 04:47
Not sure it would work for all of them though, just a suggestion
Rafael Monroy
@rafaelmonroy
Sep 12 2017 04:48
yeah it, i just added it to the replace method I aready had
not too sure I understand this logic /-{1,}/
@piteto
piteto
@piteto
Sep 12 2017 04:51
that means replace one or more of the -
{1,} <--- one or more
{2,6} <--- two to six (but not one or 7)
Rafael Monroy
@rafaelmonroy
Sep 12 2017 04:52
do you know why it was it was returning extra spaces?
@piteto
piteto
@piteto
Sep 12 2017 04:52
because str[i] will also include spaces, so you add ' ' to existing spaces that are already in the string @rafaelmonroy
str[12] in that string, for example, is a space
Rafael Monroy
@rafaelmonroy
Sep 12 2017 04:53
@piteto but I thought I had stated to only do that IF the str[i] was uppercase?
piteto
@piteto
Sep 12 2017 04:54
Sorry, I read your code too quickly... hmm, let me run it and see
Rafael Monroy
@rafaelmonroy
Sep 12 2017 04:54
i tried adding and else if ‘ ‘ was the case to just leave at is, but coulnt get it to work either, no worries @piteto
piteto
@piteto
Sep 12 2017 04:56
@rafaelmonroy in this example: small Things, you add a space before the capital letter, so you get two spaces
You would need another check: if (str[i] === str[i].toUpperCase() && i > 0 && str[i-1] != ' '){
Rafael Monroy
@rafaelmonroy
Sep 12 2017 04:59
@piteto oh ok, cool, thanks man1
CamperBot
@camperbot
Sep 12 2017 04:59
rafaelmonroy sends brownie points to @piteto :sparkles: :thumbsup: :sparkles:
api offline
Rafael Monroy
@rafaelmonroy
Sep 12 2017 05:00
i didnt know we could have multiple &&s lol
good to know
Mercy Manrique
@mers89
Sep 12 2017 05:49
does someone have knowledge with if then statement with API calls. I wanted to add more than one else statement but not sure if it make sense :)
Markus Kiili
@Masd925
Sep 12 2017 05:54
@mers89 Just post the code and try to explain the problem.
Mercy Manrique
@mers89
Sep 12 2017 05:56
@Masd925 so on my page some of the users dont have an icon because they maybe didnt upload one to begin with. I figured I would make an if then statement from the API. https://mers89.github.io/Twitch-TV-JSON-API/
@Masd925 i already told the api to pull the image of the user and display it, if user is not found display a 404 image
@Masd925 I wanted to add if the two options are not possible then display a third image (in the case that the user does not have an image to begin with)
Markus Kiili
@Masd925
Sep 12 2017 06:04
@mers89 Maybe you need a decision tree like this? Not totally sure what you need to do
if (cond1) {
  // executed if cond1 is truthy
}

else if (cond2) {
  // executed if cond1 is falsy and cond2 truthy
}

else {
  // executed if cond1 is falsy and cond2 falsy
}
Mercy Manrique
@mers89
Sep 12 2017 06:05
@mark would this work with API calls as well
piteto
@piteto
Sep 12 2017 06:06
Another option - If the logo property is null, for example, with this user: http://wind-bow.glitch.me/twitch-api/channels/septiess
You do:
userLogo = data.logo || "https://some placeholder image/logo.jpg"
the || only runs if data.logo is null
Markus Kiili
@Masd925
Sep 12 2017 06:07
@mers89 API calls don't change how values are tested. Just remember that ajax calls are async.
piteto
@piteto
Sep 12 2017 06:09
$("#logo").append("<img class='logo_row' src='" + (data3.logo || "https://placehold.it/200") + "'>");
good point though, it's just a function you run when you get data back - the function can have if/else statements, switch statements, etc, just like any other function
Mercy Manrique
@mers89
Sep 12 2017 06:15
ok thanks everyone. You guys have been so helpful. I feel like Ive been posting on the channel everyday lol
Rafael Monroy
@rafaelmonroy
Sep 12 2017 06:20

hey guys, what else can I add to my if statement to push only the prime numbers ?


function sumPrimes(num) {
  var holder = [];

  for (i=2;i<=num;i++){
    if (i / i === 1){
      holder.push(i);
    } 
  }

  return holder.reduce(function(sum, value){
    return sum + value;
  },0);
}

sumPrimes(10);

right now it pushes all the numbers because they are all divisible by 1 lol, I dont know how to write the logic to say then can ONLY be divisible by 1 and nothing else

piteto
@piteto
Sep 12 2017 06:22
@rafaelmonroy It's a common interview question - write a function that determines if a number is prime or not
Markus Kiili
@Masd925
Sep 12 2017 06:23
@rafaelmonroy You can test the looped candidate number for divisibility against the primes generated so far. If it is not evenly divisible by any of them, it is a prime and should be pushed into the array of primes.
piteto
@piteto
Sep 12 2017 06:23
The way you have your for loop set up now, if the number is prime, push it to your array. https://stackoverflow.com/questions/40200089/is-a-number-prime
Markus Kiili
@Masd925
Sep 12 2017 06:24
@rafaelmonroy Any way, you need another loop for the primality check.
Rafael Monroy
@rafaelmonroy
Sep 12 2017 06:27
@piteto @Masd925 thanks guys, let me see if I can figure it out now
CamperBot
@camperbot
Sep 12 2017 06:27
rafaelmonroy sends brownie points to @piteto and @masd925 :sparkles: :thumbsup: :sparkles:
:cookie: 97 | @piteto |http://www.freecodecamp.com/piteto
:star2: 4479 | @masd925 |http://www.freecodecamp.com/masd925
Muhammad Ruhul Amin
@gskls
Sep 12 2017 12:16
[ ruhulamin3482/pure-html5#1 ] is a simple issue for beginners. Wanna work out?
Beginners should be really active.This is so simple yet looks pretty
Go please and help!!
Renan Teixeira Ferraz
@RTFerraz
Sep 12 2017 12:43
Good morning
I can't find out what is Access-Control-Allow-Origin
Adel
@AdelMahjoub
Sep 12 2017 13:26
cors.png
@MRamin3482 this is basically what happens
Elizabeth Paul
@Kowalatam
Sep 12 2017 13:55
hello.. so the code at line 24 runs immediately u click start even though its not supposed to .. why ?
i don't want it to run until that condition is met.. line 25 runs as its supposed to but that other dude doesnt
Markus Kiili
@Masd925
Sep 12 2017 14:01
@Kowalatam seconds === "03" || "02" || "01" needs to be (seconds === "03" || seconds==="02" || seconds==="01")
The first condition is always truthy because "02" and "01" are truthy as non-empty strings.
Elizabeth Paul
@Kowalatam
Sep 12 2017 14:04
@Masd925 i don't understand.. it applied it and it worked
but i don't understand ur explanation of why
because the code below that one runs correctly at that point..
Markus Kiili
@Masd925
Sep 12 2017 14:05
@Kowalatam seconds === "03" || "02" || "01" means seconds === "03" OR "02" OR "03".
Elizabeth Paul
@Kowalatam
Sep 12 2017 14:06
@Masd925 ohhh.. i see.. thought it meant seconds ==="03" || seconds === "02" and so on
Markus Kiili
@Masd925
Sep 12 2017 14:06
"02" is a truthy value so if(seconds === "03" || "02" || "01") would always fire.
Elizabeth Paul
@Kowalatam
Sep 12 2017 14:06
thanks @Masd925
CamperBot
@camperbot
Sep 12 2017 14:06
kowalatam sends brownie points to @masd925 :sparkles: :thumbsup: :sparkles:
:star2: 4481 | @masd925 |http://www.freecodecamp.com/masd925
Elizabeth Paul
@Kowalatam
Sep 12 2017 14:08

always fire meaning it won't work as i want it to ?

"02" is a truthy value so if(seconds === "03" || "02" || "01") would always fire.

@Masd925
Markus Kiili
@Masd925
Sep 12 2017 14:09
@Kowalatam That if block would always be executed because "02" is truthy.
heroiczero
@heroiczero
Sep 12 2017 14:09
@Kowalatam means it will always be big text and your color was working because you only defined it for 3,2,1 in your color object
Elizabeth Paul
@Kowalatam
Sep 12 2017 14:10
ohhh.. yep yep... i get it now... @Masd925 @heroiczero thanks
CamperBot
@camperbot
Sep 12 2017 14:10
kowalatam sends brownie points to @masd925 and @heroiczero :sparkles: :thumbsup: :sparkles:
:star2: 1720 | @heroiczero |http://www.freecodecamp.com/heroiczero
api offline
Markus Kiili
@Masd925
Sep 12 2017 14:11
@Kowalatam You need to use it like if(cond1 || cond2 || cond3) and "02" as a condition is always evaluated as true.
Elizabeth Paul
@Kowalatam
Sep 12 2017 14:11
that just made that if statement even longer :(
lol..
Renan Teixeira Ferraz
@RTFerraz
Sep 12 2017 14:21
@heroiczero I'm having trouble doing the wikipedia viewer
Renan Teixeira Ferraz
@RTFerraz
Sep 12 2017 14:27
I read that page about access control allow origin
and I'm still lost
Aditya Gupta
@adityagupta4213
Sep 12 2017 14:29
Hey guys, can anyone help me tell what structure exactly is this
{
        key: 
            User {
                id: '0',
                username: 'xyz', 
            }
    }
imperial-isms
@imperial-isms
Sep 12 2017 14:35
Just popped by this morning to say "thank you" to all the help I've received so far. I also want to put it out there that I'm available to help, as well. I'm currently on the Wikipedia Viewer, so if you think I can help with anything in the curriculum that precedes that project, don't hesitate to reach out to me. What's good for you is good for me! I'm about to board a plane, so I'm speaking in general. 😁👍🛫
Renan Teixeira Ferraz
@RTFerraz
Sep 12 2017 14:37
@imperial-isms You're on the wikipedia viewer?
Markus Kiili
@Masd925
Sep 12 2017 14:37
@adityagupta4213 I can only say that it is not correct syntax as Javascript.
Aditya Gupta
@adityagupta4213
Sep 12 2017 14:37
I got that as a response from an API
And I need to separate the id from it
imperial-isms
@imperial-isms
Sep 12 2017 14:38
@RTFerraz yup!
Aditya Gupta
@adityagupta4213
Sep 12 2017 14:38
@RTFerraz
Renan Teixeira Ferraz
@RTFerraz
Sep 12 2017 14:42
@adityagupta4213 ?
Aditya Gupta
@adityagupta4213
Sep 12 2017 14:42
I got that as a response from an API
And I need to separate the id from it
Renan Teixeira Ferraz
@RTFerraz
Sep 12 2017 14:42
@imperial-isms did you find out how to get the HTTP request?
using the $.getJSON(url) I can get the request
but I can't allocate the response in a variable
Elizabeth Paul
@Kowalatam
Sep 12 2017 14:47

that would give an error ... sure something is not mission ? @adityagupta4213

Hey guys, can anyone help me tell what structure exactly is this

{
        key: 
            User {
                id: '0',
                username: 'xyz', 
            }
    }
key: user {} ???
not seen that before...
Aditya Gupta
@adityagupta4213
Sep 12 2017 14:48
@Kowalatam Yes because I got it as a response from the Discord API
imperial-isms
@imperial-isms
Sep 12 2017 14:49
I'm having trouble with this exact thing. The getJSON is self-containing and locks in any variables within the method. You have to write a function that assigns the returning value of the getJSON method to the returnint value of the function wrapped around the getJSON method.
Markus Kiili
@Masd925
Sep 12 2017 14:49
@RTFerraz You need to pass a callback function to that getJson method in order to use the response.
Elizabeth Paul
@Kowalatam
Sep 12 2017 14:51
@adityagupta4213 then the response is wrong ? lol... it's probably the api's problem,, dunno
Renan Teixeira Ferraz
@RTFerraz
Sep 12 2017 14:52
@Masd925 @imperial-isms OK, I'll try here
Aditya Gupta
@adityagupta4213
Sep 12 2017 14:52
@Kowalatam Haha, not really. Since that API is Discord's (http://www.discord.com), I would highly doubt that. More likely something I'm missing on the docs
Elizabeth Paul
@Kowalatam
Sep 12 2017 14:54
if u say so... they are still humans though lol
Markus Kiili
@Masd925
Sep 12 2017 15:00
@Kowalatam That structure is actually how JS console shows an object with one key "key"and value an object made by constructor User with those properties. I was able to replicate it.
    function User (){
      this.id = "0";
      this.username = "xyz";
    }
    var user = new User();
    var obj = {key:user};
    console.log(obj); // { key: User { id: '0', username: 'xyz' } }
Elizabeth Paul
@Kowalatam
Sep 12 2017 15:03
@Masd925 huh .. still weird.. :)
Markus Kiili
@Masd925
Sep 12 2017 15:05
@Kowalatam Seems that that is just how property values that are objects are logged.
Elizabeth Paul
@Kowalatam
Sep 12 2017 15:06
@Masd925 then in that case how do u access it ?
Markus Kiili
@Masd925
Sep 12 2017 15:06
@Kowalatam In my code, obj.key.id would be "0"
In your code use whatever variable holds the object.
Elizabeth Paul
@Kowalatam
Sep 12 2017 15:07
ohh yeah.. true..
Markus Kiili
@Masd925
Sep 12 2017 15:08
@Kowalatam I apologize for my original lack of knowledge. Shame...shame...shame...
Elizabeth Paul
@Kowalatam
Sep 12 2017 15:09
@Masd925 apology not accepted
i didn't ask the question lol
@adityagupta4213 did
*rings bells while following u around
:)
Markus Kiili
@Masd925
Sep 12 2017 15:10
@Kowalatam I think 10 hours of looking at the screen has done its job ;)
Elizabeth Paul
@Kowalatam
Sep 12 2017 15:11
@Masd925 10 hours ?.. i have only done that for a seasonal animation movie.. :)
not this.... nope... i don't think so..
imperial-isms
@imperial-isms
Sep 12 2017 15:12
Welcome to Crazy Town!
Elizabeth Paul
@Kowalatam
Sep 12 2017 15:13
currently thinking of submitting my current project instead on working on it to make it look like i want it to ... to escape work.... :)
Jorge
@OrangeKulture
Sep 12 2017 15:19
hey hows it going fellow coders
Elizabeth Paul
@Kowalatam
Sep 12 2017 15:20
slow and quiet ...
Jorge
@OrangeKulture
Sep 12 2017 15:21
yeah i can see that ... this front end party has been plummeting as of late
i guess there's only one thing left to do .. im going to be flying to europe to snatch and consequently bring back Sky into this room
Elizabeth Paul
@Kowalatam
Sep 12 2017 15:22
yeah.. it's school though.. atleast thats what i think
ohhh yeah... i knew smtin was different/missing lol
:)
Jorge
@OrangeKulture
Sep 12 2017 15:23
yeah also that FCC removed the link to chat from the homepage .. that kinda contributes to it being a tad slower, imo
Elizabeth Paul
@Kowalatam
Sep 12 2017 15:24
yeah.. lil/no new folks...
and a bunch of lazy ppl :)
like me:)
Jorge
@OrangeKulture
Sep 12 2017 15:24
hahah
i think we all have that lazy side to us ..
i like to think it's not really lazy, we just like to relax a lot
Elizabeth Paul
@Kowalatam
Sep 12 2017 15:25
nope.. u are just making it sound good...
its LAZINESS,...
anyway... i need help
so i'm thinking of having my timer display in my background when it reaches 3,2,1
like changing with the colors and only the seconds appearing and as if its in the background
not just increasing font as it currently does https://codepen.io/Kowalatam/full/LjqJmW/
Renan Teixeira Ferraz
@RTFerraz
Sep 12 2017 15:29
@Masd925 @imperial-isms thanks, I'm getting the data now
CamperBot
@camperbot
Sep 12 2017 15:29
rtferraz sends brownie points to @masd925 and @imperial-isms :sparkles: :thumbsup: :sparkles:
:cookie: 140 | @imperial-isms |http://www.freecodecamp.com/imperial-isms
:star2: 4482 | @masd925 |http://www.freecodecamp.com/masd925
Jorge
@OrangeKulture
Sep 12 2017 15:29
looking at your pen
Elizabeth Paul
@Kowalatam
Sep 12 2017 15:32
cool.. thanks in advance.. :)
Jorge
@OrangeKulture
Sep 12 2017 15:32
what do u mean in the background?
looks nice !
Elizabeth Paul
@Kowalatam
Sep 12 2017 15:33
as the different colors flash
i want it flashing along with it like its attached to the background color and huge
let me see if i can see something like it
or maybe i just need to make a background image with the numbers on it :)
Jorge
@OrangeKulture
Sep 12 2017 15:35
oh right ... yeah u could still do it with text, maybe have it within the body tags, set font and position and have it display when the counter reached X secs or something?
or
yeah exactly
have it be an image too
just a lil photoshop
Elizabeth Paul
@Kowalatam
Sep 12 2017 15:35
i know not photoshop ....
Jorge
@OrangeKulture
Sep 12 2017 15:36
i can help you out for sure .. shouldnt be too hard
i love some photoshop
Elizabeth Paul
@Kowalatam
Sep 12 2017 15:36
awesome.. thank u @OrangeKulture
CamperBot
@camperbot
Sep 12 2017 15:36
kowalatam sends brownie points to @orangekulture :sparkles: :thumbsup: :sparkles:
:cookie: 463 | @orangekulture |http://www.freecodecamp.com/orangekulture
Jorge
@OrangeKulture
Sep 12 2017 15:36
i have to go for a lil while tho, my dog is reaching the point of no return :joy:
Elizabeth Paul
@Kowalatam
Sep 12 2017 15:36
was considering just skipping to the next project
Jorge
@OrangeKulture
Sep 12 2017 15:36
he really wants to go for his walk
Elizabeth Paul
@Kowalatam
Sep 12 2017 15:36
:)
:+1: @OrangeKulture
Jorge
@OrangeKulture
Sep 12 2017 15:37
be back within the hour, hopefully youre still around
Elizabeth Paul
@Kowalatam
Sep 12 2017 15:38
yeah... i will.. just won't be at school...
home sweet home lol
MrCode0
@MrCode0
Sep 12 2017 16:18
This the place to ask for help if you need it with code?
Elizabeth Paul
@Kowalatam
Sep 12 2017 16:24
@MrCode0 yes. It's one of the places
😊
MrCode0
@MrCode0
Sep 12 2017 16:28
Nice thanks
Elizabeth Paul
@Kowalatam
Sep 12 2017 16:33
welcome @MrCode0
Jorge
@OrangeKulture
Sep 12 2017 17:02
i see it's still slow :D
Elizabeth Paul
@Kowalatam
Sep 12 2017 17:03
Way xlw... The JavaScript section has more live... 😂😂😂
Jorge
@OrangeKulture
Sep 12 2017 17:04
yeah i guess ill have to switch over sometime
Elizabeth Paul
@Kowalatam
Sep 12 2017 17:05
So unfair though...
Would have loved to get some Brownie points from newbies.. 😂😂😂
Jorge
@OrangeKulture
Sep 12 2017 17:06
yeah, whatever happened to the brownie points .. i guess cbot is slacking and hasnt baked any new batches
Elizabeth Paul
@Kowalatam
Sep 12 2017 17:07
😂😂😂... They always tasted funny...
Jorge
@OrangeKulture
Sep 12 2017 17:08
:joy:
Alex
@cyberpunk1971
Sep 12 2017 17:12

Hello all. I have a javascript error that I can't figure out. I'm wondering if someone can lend a hand. I'm getting an Uncaught syntax error: Unexpected token { on line 2. Here is the code: function Person() {
this.greet = funcion() {
console.log("Hello there!");
}
}

var alex = new Person();
alex.greet();

function Person() {
this.greet = funcion() {
console.log("Hello there!");
}
}

var alex = new Person();
alex.greet();

sry i doubled that
let me try again.

function Person() {
this.greet = funcion() {
console.log("Hello there!");
}
}

var alex = new Person();
alex.greet();

is anyone in the room?
Jorge
@OrangeKulture
Sep 12 2017 17:17
i dont think u can use a constructor like that in javascript
u are saying this.greet = function, the person constructor doesnt know what 'this' is referring to
Alex
@cyberpunk1971
Sep 12 2017 17:20
hmm. i wrote it up exactly as the instructor did.
Jorge
@OrangeKulture
Sep 12 2017 17:20
function Person(greet){
  this.greet = function(){
    console.log(greet);
  }
}
var rob = new Person('hello');
rob.greet();
i would also use let and const instead of var
@cyberpunk1971 ^
Daniel Feldman
@Feldbot
Sep 12 2017 17:22
Hi, I'm having some strange issues with my Wikipedia viewer. When I try to submit a query, it often takes multiple times trying to submit to go through. Then when it does, I'm getting the object back, but can't inspect it because another error occurs right after that ("Uncaught DOMException: Blocked a frame with origin "https://s.codepen.io" from accessing a cross-origin frame.") I'm not using frames so I don't know what is going on there. Also can't figure out why the button or enter keypress doesn't work consistently. Any ideas?
https://codepen.io/Feldbot/pen/JyQzVL?editors=1111
Elizabeth Paul
@Kowalatam
Sep 12 2017 17:23
always meant to ask check about "let" ... i'm still using var
Jorge
@OrangeKulture
Sep 12 2017 17:24
@Feldbot i think your endpoint is wrong
Alex
@cyberpunk1971
Sep 12 2017 17:25
@OrangeKulture thx dude, still getting the error.
CamperBot
@camperbot
Sep 12 2017 17:25
cyberpunk1971 sends brownie points to @orangekulture :sparkles: :thumbsup: :sparkles:
:cookie: 464 | @orangekulture |http://www.freecodecamp.com/orangekulture
Jorge
@OrangeKulture
Sep 12 2017 17:25
@Feldbot or not actually wrong, but you are not passing in the url parameters correctly
@cyberpunk1971 what do u mean? the code i wrote console.logs hello
@Feldbot im using open search too .. this is my call
      var resp = $('#query').val();
      var url = 'https://en.wikipedia.org/w/api.php?action=opensearch&search=' + resp + '&format=json&limit=3&callback=?';

      // API
      $.ajax({
        url: url,
        type: "GET",
        async: false,
        dataType: "json",
        success: function(data, status) {
           // do some magic
        }
Alex
@cyberpunk1971
Sep 12 2017 17:28
@OrangeKulture i'm not sure what to say, but it's having a problem with an opening curly.
Jorge
@OrangeKulture
Sep 12 2017 17:28
@cyberpunk1971 that's probably because you have a typo somewhere
can you paste all of the code?
Christopher McCormack
@cmccormack
Sep 12 2017 17:29
@Feldbot you need to prevent the default submit action of a form, else your page will reload. Forms expect your data to be sent to a backend then the page will refresh. I recommend either getting rid of forms altogether, or use the .preventDefault() method:
$('form').submit((e)=>e.preventDefault())
Jorge
@OrangeKulture
Sep 12 2017 17:31
i guess you limit is optional ... hmm
Alex
@cyberpunk1971
Sep 12 2017 17:31

@OrangeKulture function Person(fullName, favColor) {
this.name = fullName;
this.favoriteColor = favColor;
this.greet = funcion() {
console.log("Hello, my name is " this.name + " and my favorite color is " + this.favoriteColor + ".");
}
}

var alex = new Person("Alex", "blue");
alex.greet();

var dave = new Person("Dave", "red");
dave.greet();

Jorge
@OrangeKulture
Sep 12 2017 17:32
@cyberpunk1971 u cant say this.greet
the constructor doesnt know what this refers to
Alex
@cyberpunk1971
Sep 12 2017 17:33
hmm, i'm curious as to why the instructor would write it that way. It works in his console.
Jorge
@OrangeKulture
Sep 12 2017 17:33
or maybe you can .. who knows, i just never create objects like that
Alex
@cyberpunk1971
Sep 12 2017 17:34
oh well, thanks for offering my friend. hopefully the instructor will get back to me soon. Again, thx. @OrangeKulture
CamperBot
@camperbot
Sep 12 2017 17:34
cyberpunk1971 sends brownie points to @orangekulture :sparkles: :thumbsup: :sparkles:
api offline
Elizabeth Paul
@Kowalatam
Sep 12 2017 17:34
if its a youtube video... can check it out
@cyberpunk1971
Alex
@cyberpunk1971
Sep 12 2017 17:35
@Kowalatam it's a paid course
Elizabeth Paul
@Kowalatam
Sep 12 2017 17:35
@cyberpunk1971 i see.. udemy ?..
Alex
@cyberpunk1971
Sep 12 2017 17:35
yeah
web developer workflow course
piteto
@piteto
Sep 12 2017 17:36

@cmccormack I've seen you mention this a few times:

Forms expect your data to be sent to a backend

From my understanding, forms expect data to be submitted to a server - which can be handled on the front end. Back end is not an expectation - but can be a best practice depending on the scenario (validation, for example)

Alex
@cyberpunk1971
Sep 12 2017 17:36
@Kowalatam yeah
Elizabeth Paul
@Kowalatam
Sep 12 2017 17:37
@cyberpunk1971 ohh.. don't have that one...
there is a javascript chat room
Christopher McCormack
@cmccormack
Sep 12 2017 17:37
@piteto If the page refreshes how do you expect to use it on the frontend?
Alex
@cyberpunk1971
Sep 12 2017 17:37
@Kowalatam ill check em out, thank you
CamperBot
@camperbot
Sep 12 2017 17:37
cyberpunk1971 sends brownie points to @kowalatam :sparkles: :thumbsup: :sparkles:
:cookie: 316 | @kowalatam |http://www.freecodecamp.com/kowalatam
piteto
@piteto
Sep 12 2017 17:38
@cmccormack the refresh is the default behavior whether you use front end or back end
The difference, with backend of course, is that it will then provide some data based on what was submitted
Christopher McCormack
@cmccormack
Sep 12 2017 17:40

I'm not sure I understand your point - are you saying what I said was incorrect?
From MDN:

The HTML <form> element represents a document section that contains interactive controls to submit information to a web server.

I am not saying you can't use it in different ways, but the default action is to submit some data to a backend then refresh. If you have no backend, then it will just refresh. You cannot use this information on the frontend unless you're pulling the updated data from somewhere on the refresh.

Jorge
@OrangeKulture
Sep 12 2017 17:40
@cyberpunk1971 ok .. yeah u can actually define greet like that
has to be a typo somewhere in your code
piteto
@piteto
Sep 12 2017 17:41
@cmccormack I'm just curious if maybe I'm mistaken. In my understanding, codepen is the web server we're submitting the data to.
And all the code logic is happening on the front end - which is valid JS and HTML
Christopher McCormack
@cmccormack
Sep 12 2017 17:43
You are not submitting anything to codepen
Daniel Feldman
@Feldbot
Sep 12 2017 17:43
@cmccormack @piteto I replaced the <form> element with a div and it did get rid of the glitchy behavior trying to submit. Removing the <form> element also removes the submit behavior when a user hits enter. I'm trying to figure that out now.
piteto
@piteto
Sep 12 2017 17:44
Right, when you prevent the default, nothing gets submitted - forms are allowed to have their reset action canceled for this scenario
Christopher McCormack
@cmccormack
Sep 12 2017 17:44
@piteto If you wanted to handle it on the backend you would need something like PHP running that can take in the submitted data and handle it somehow
Jorge
@OrangeKulture
Sep 12 2017 17:44
@cyberpunk1971 got it working .. i dont know what's up tbh :D
piteto
@piteto
Sep 12 2017 17:44
(again, not disagreeing, just trying to clarify my own understanding :))
Jorge
@OrangeKulture
Sep 12 2017 17:45
@cyberpunk1971
function Person(fullName,favColor){
  this.name = fullName;
  this.favColor = favColor;
  this.greet = function(){
    console.log('hello');
  }
}

var alex = new Person('alex','blue');
alex.greet();
Christopher McCormack
@cmccormack
Sep 12 2017 17:45
@piteto just found this article and it seems to be pretty well written on the subject: https://mdn.io/Sending_and_retrieving_form_data
Jorge
@OrangeKulture
Sep 12 2017 17:45
with forms, you can prevent default and it usually takes care of the prob
piteto
@piteto
Sep 12 2017 17:46
To summarize, maybe more clearly, forms are designed for submitting to a server, but they're also designed to allow that action to be canceled for handling the logic on the front end
Jorge
@OrangeKulture
Sep 12 2017 17:46
is that what u guys are talking about?
piteto
@piteto
Sep 12 2017 17:46
Yeah, that's what I'm trying to clarify @OrangeKulture
my understanding is that it is not a bad practice to cancel the reset() that happens by default with a form
Jorge
@OrangeKulture
Sep 12 2017 17:48
that's only done for validation purposes
piteto
@piteto
Sep 12 2017 17:48
(so it can be handled on the front end) but I can't find any docs that talk about best practices around this
Jorge
@OrangeKulture
Sep 12 2017 17:48
basically u would want to validate the info before submitting to backend .. all form handling needs to be done on the backend for various reasons, security being the most important
Christopher McCormack
@cmccormack
Sep 12 2017 17:48
@piteto not necessarily designed around canceling, but that is a feature of Javascript. I believe e.preventDefault prevents the action from being propagated to the form. If you aren't using a form to talk to a backend, you can probably remove it. Only reason you may want to keep it is if your CSS library depends on it for styles
piteto
@piteto
Sep 12 2017 17:48
validation definitely needs to happen on the backend, otherwise the user can bypass your validation code
Jorge
@OrangeKulture
Sep 12 2017 17:49
u usually pass in the info before submitting to backend .. regex is used along with other stuff, mostly to prevent script injection
Alex
@cyberpunk1971
Sep 12 2017 17:49
@OrangeKulture ..................

function Person(fullName, favColor){
this.name = fullName;
this.favoriteColor = favColor;
this.greet = funcion(){
console.log("Hello");
}
}

var alex = new Person("Alex", "blue");
alex.greet();

Jorge
@OrangeKulture
Sep 12 2017 17:50
u got it, right? @cyberpunk1971
@cyberpunk1971 i tested with the code i wrote above, and it did work just fine
piteto
@piteto
Sep 12 2017 17:51
@cmccormack Okay, if I understand correctly, you're saying it's a bad practice to use a <form> with e.preventDefault?
Alex
@cyberpunk1971
Sep 12 2017 17:51
jssnippet.PNG
still getting error
Christopher McCormack
@cmccormack
Sep 12 2017 17:51
@piteto I'm not saying it's bad practice, just saying if you can avoid using a form when you don't actually require submitting data to a backend you probably should
Alex
@cyberpunk1971
Sep 12 2017 17:52
@OrangeKulture
Christopher McCormack
@cmccormack
Sep 12 2017 17:52
If you look at all the bootstrap "Forms" none of them really use the <form> tag
piteto
@piteto
Sep 12 2017 17:52
Okay, so you're saying it is better to have keypress eventlisteners on text fields and click event listeners on buttons
Jorge
@OrangeKulture
Sep 12 2017 17:52
i just tested it and it does work for me .. what IDE are u using? what is the error msg?
Christopher McCormack
@cmccormack
Sep 12 2017 17:53
@piteto probably, if you want complete control I would say yes
Alex
@cyberpunk1971
Sep 12 2017 17:53
oh well, thx @OrangeKulture . time to do some laundry
CamperBot
@camperbot
Sep 12 2017 17:53
cyberpunk1971 sends brownie points to @orangekulture :sparkles: :thumbsup: :sparkles:
api offline
piteto
@piteto
Sep 12 2017 17:54
Thanks @cmccormack I just can't seem to find any docs that say one way is preferred, and I always thought it was better to let the browser handle the keypresses and clicks instead
CamperBot
@camperbot
Sep 12 2017 17:54
piteto sends brownie points to @cmccormack :sparkles: :thumbsup: :sparkles:
:star2: 1205 | @cmccormack |http://www.freecodecamp.com/cmccormack
Daniel Feldman
@Feldbot
Sep 12 2017 17:54
I'm curious why I still am getting this "SecurityError: Blocked a frame with origin from accessing a cross-origin frame" error too. Wikipedia is sending the object back, but I'm still getting that error.
Jorge
@OrangeKulture
Sep 12 2017 17:54
@cyberpunk1971 check out this example .. its the exact same code, and it works
@Feldbot i already mentioned that ... it has to do with the request headers
Christopher McCormack
@cmccormack
Sep 12 2017 17:54
@piteto if you find anything that contradicts my understanding I'm all ears!
piteto
@piteto
Sep 12 2017 17:55
@cmccormack I can't seem to find anything for or against it, so was definitely curious!
Elizabeth Paul
@Kowalatam
Sep 12 2017 17:57
@cyberpunk1971 i think its the missing t in "function". you wrote "funcion
seriously almost got my eyes hurting trying to match the two :)
@cyberpunk1971 same problem right from the first code u posted
@OrangeKulture i'm waiting patiently lol.... remember me ?
:)
Alex
@cyberpunk1971
Sep 12 2017 18:01
@Kowalatam god i'm so stupid
Jorge
@OrangeKulture
Sep 12 2017 18:01
@Kowalatam wahaha awesome stuff! thanks for that .. and sry about the image, yeah im trying to do a carousel for angular 2 :S proving to be a bit challenging
CamperBot
@camperbot
Sep 12 2017 18:01
orangekulture sends brownie points to @kowalatam :sparkles: :thumbsup: :sparkles:
:cookie: 317 | @kowalatam |http://www.freecodecamp.com/kowalatam
Jorge
@OrangeKulture
Sep 12 2017 18:01
ohh yeaaaah! brownies!!
Alex
@cyberpunk1971
Sep 12 2017 18:02
@Kowalatam Thank you so much lol. I'm going to take a break now and berate myself in the mirror. Thank you again. and Thx Jorge too
CamperBot
@camperbot
Sep 12 2017 18:02
cyberpunk1971 sends brownie points to @kowalatam :sparkles: :thumbsup: :sparkles:
api offline
Jorge
@OrangeKulture
Sep 12 2017 18:02
sure thing, welcome!
dammit cbot
u only made 1 brownie?
Elizabeth Paul
@Kowalatam
Sep 12 2017 18:03
i don't know what that is yet... @OrangeKulture ... but i will wait...
Jorge
@OrangeKulture
Sep 12 2017 18:03
nah its all good
lets do it
Elizabeth Paul
@Kowalatam
Sep 12 2017 18:03
lol yeah... she didn't tag u :)
or he.... dunno....
Jorge
@OrangeKulture
Sep 12 2017 18:03
api offline
@cyberpunk1971 thanks
CamperBot
@camperbot
Sep 12 2017 18:03
orangekulture sends brownie points to @cyberpunk1971 :sparkles: :thumbsup: :sparkles:
:cookie: 122 | @cyberpunk1971 |http://www.freecodecamp.com/cyberpunk1971
Jorge
@OrangeKulture
Sep 12 2017 18:03
dammit
Elizabeth Paul
@Kowalatam
Sep 12 2017 18:03
:) :)
what are u doing lol
Jorge
@OrangeKulture
Sep 12 2017 18:04
so .. u want to have an image?
Elizabeth Paul
@Kowalatam
Sep 12 2017 18:04
take your time though...
kinda googling on some school assignment... i need to find a random project i might be interested in to work on:(
Alex
@cyberpunk1971
Sep 12 2017 18:05
@OrangeKulture I love CR dude. I went there about 10 yrs ago. Perfect weather. I stayed at this eco lodge in puerto nuevo . Beautiful place. Pura Vida.
Elizabeth Paul
@Kowalatam
Sep 12 2017 18:05
@cyberpunk1971 it happens lol... seriously might not be able to count how many times lol
Alex
@cyberpunk1971
Sep 12 2017 18:06
anyway, i'm out for awhile yall, gotta take a break. @Kowalatam thx, and @OrangeKulture thx
CamperBot
@camperbot
Sep 12 2017 18:06
cyberpunk1971 sends brownie points to @kowalatam and @orangekulture :sparkles: :thumbsup: :sparkles:
api offline
api offline
Jorge
@OrangeKulture
Sep 12 2017 18:06
@cyberpunk1971 ahh shit nice! yeah i love my country
im thinking u mean puerto viejo, probably
Daniel Feldman
@Feldbot
Sep 12 2017 18:07
@OrangeKulture Thanks, I tried that method out and it got rid of the CORS error
CamperBot
@camperbot
Sep 12 2017 18:07
feldbot sends brownie points to @orangekulture :sparkles: :thumbsup: :sparkles:
:cookie: 465 | @orangekulture |http://www.freecodecamp.com/orangekulture
Daniel Feldman
@Feldbot
Sep 12 2017 18:09
@cmccormack @piteto Thanks for the suggestions on the form submission
CamperBot
@camperbot
Sep 12 2017 18:09
feldbot sends brownie points to @cmccormack and @piteto :sparkles: :thumbsup: :sparkles:
:cookie: 98 | @piteto |http://www.freecodecamp.com/piteto
:star2: 1206 | @cmccormack |http://www.freecodecamp.com/cmccormack
Jorge
@OrangeKulture
Sep 12 2017 18:09
@Kowalatam to be honest, i would probably do it with text, have the text within the body tag, maybe have it display: none on css and even give it transition to transform: scale , so that it grows a little as it comes to the end of the second
@Feldbot welcome! glad it helped
piteto
@piteto
Sep 12 2017 18:10
Thank you too! @Feldbot :) brought up an interesting conversation that I hope to learn from. I used a <form> in my project and in similar projects in the past, but never really thought about the "best" way to handle the logic. Hopefully will gain some clarity around this soon.
CamperBot
@camperbot
Sep 12 2017 18:10
piteto sends brownie points to @feldbot :sparkles: :thumbsup: :sparkles:
:cookie: 299 | @feldbot |http://www.freecodecamp.com/feldbot
piteto
@piteto
Sep 12 2017 18:10
far too often with code, if it works, it doesn't mean it's a good way to do it
Elizabeth Paul
@Kowalatam
Sep 12 2017 18:11
@OrangeKulture i will try that.. might gimme should css points,,... i don't like it/ use it very much
im usually more on the if it works than how it looks :)
Daniel Feldman
@Feldbot
Sep 12 2017 18:12
@piteto I was noting that too, I'll be on the watch for how to submit forms!
Jorge
@OrangeKulture
Sep 12 2017 18:12
haha yeah .. i love graphic design, so thats probs why i spend a long time on the looks
Elizabeth Paul
@Kowalatam
Sep 12 2017 18:13
this is the only project i know i spend a few trying to make it look nice
usually would have moved on by now...
but seeing how awesome ppl's project looks.. giving me a lil motivation
and sometimes discouragement :)
Pagnito
@Pagnito
Sep 12 2017 18:29
who knows css grid pretty good at this point?
Elizabeth Paul
@Kowalatam
Sep 12 2017 18:32
when i hear grid i see bootstrap lol
Pagnito
@Pagnito
Sep 12 2017 18:33
lol, nah i mean the new css grid
Elizabeth Paul
@Kowalatam
Sep 12 2017 18:34
not me then.. :(
Daniel Feldman
@Feldbot
Sep 12 2017 18:55
incidentally, the CORS error I was getting on my codepen projects is something in the codepen app. I opened a brand new pen and still get the error. Looks like it has something to do with Bootstrap.
Christopher McCormack
@cmccormack
Sep 12 2017 19:03
@Feldbot CORS errors occur between the browser and the destination server usually - if this was the wikipedia API you may need to add the origin='*' parameter or use JSONP
The destination has to permit the source domain (in this case codepen) access. I do this on my server by adding an .htaccess file with the contents Header set Access-Control-Allow-Origin "*"
I'm guessing many APIs do not allow this though, but might provide workarounds like Wikipedia does - https://www.mediawiki.org/wiki/API:Cross-site_requests
Daniel Feldman
@Feldbot
Sep 12 2017 19:18
@cmccormack Yes, I've been struggling with that for quite awhile. Amusingly, I read Wikipedia docs for about 8 hours trying to figure out why my call wasn't working, and then discovered I had origin: "*" outside my data: property on my AJAX call. Good times!
Christopher McCormack
@cmccormack
Sep 12 2017 19:19
@Feldbot oh no haha
christopher clarke
@chrisdclarke
Sep 12 2017 19:20
hey guys,, im working on the quote machine,, how do you get the tumblr and twitter buttons to show the company logo on the button??
just using href?
iso
@iso1048
Sep 12 2017 19:22
@chrisdclarke use fontawesome. http://fontawesome.io/
christopher clarke
@chrisdclarke
Sep 12 2017 19:23
ok thanks. @gothamknight
CamperBot
@camperbot
Sep 12 2017 19:23
chrisdclarke sends brownie points to @gothamknight :sparkles: :thumbsup: :sparkles:
:cookie: 425 | @gothamknight |http://www.freecodecamp.com/gothamknight
Daniel Feldman
@Feldbot
Sep 12 2017 19:25
@chrisdclarke You can also try adding the twttr.widgets.createShareButton button which places the button with text for you
Mike
@MikeJSchorah
Sep 12 2017 19:50
Someone on here told me that if you don't use a child theme, it will destroy your styling on updates
piteto
@piteto
Sep 12 2017 19:51

I went down a rat hole researching this @Feldbot @cmccormack :)
From what I can tell, without a backend both ways are correct and valid.

Reasons for <form>:

  • <form> required to post when javascript is disabled (not relevant, but hadn't considered it!)
  • <form> is required if you are submitting to a back end, though HTML 5 has a form name attribute, so controls don't necessarily need to be inside a common <form> element.
  • <form> is required to reset() all elements inside the form back to default values
  • some older screen readers require controls to be in a <form> element for accessibility
  • Mobile keyboards will not show a "go" or "search" button without a <form> element
  • Able to work with semantics provided by the browser on submit() instead of doing: event.which || event.charCode || event.keyCode for your keydown events.
  • Logical grouping and enhanced semantics by including controls inside a <form> element - or using HTML5's form name attribute.

Reasons for not using a <form>:

  • Ugly bugs can result in more complex applications when stopping propagation, preventing default, or returning false with event listeners.
  • It's valid HTML to have controls outside of a <form>, if you don't have a back end, no need for a <form>.
  • If you aren't using a back end, the code is more explicit outside of a <form> and jQuery can take care of browser semantics if you use event.which
I cannot find a single page saying one is "best", it depends on the app and customer requirements
Christopher McCormack
@cmccormack
Sep 12 2017 19:54
@piteto Good research, this matches up well with my understanding. The submit() listener is quite helpful but it's also not difficult to use specific listeners
Mike
@MikeJSchorah
Sep 12 2017 19:56
Just updated Divi and not a single piece of CSS was deleted
Daniel Feldman
@Feldbot
Sep 12 2017 19:57
@piteto Thanks for braving the rathole of death! You came back alive with some great insight :-)
CamperBot
@camperbot
Sep 12 2017 19:57
feldbot sends brownie points to @piteto :sparkles: :thumbsup: :sparkles:
:cookie: 99 | @piteto |http://www.freecodecamp.com/piteto
piteto
@piteto
Sep 12 2017 19:58
I learned a lot!
@MikeJSchorah That was me - it depends on what files get updated in your theme. If you get new CSS files with your theme update, your existing CSS files will be replaced
Mike
@MikeJSchorah
Sep 12 2017 20:00
But I didn't use a file. I used the Divi Builder. @piteto
piteto
@piteto
Sep 12 2017 20:01
I don't know what the Divi builder is - but if you update the core theme's CSS files and you then get an update to your theme that updates the CSS, then your modifications will be overwritten
Mike
@MikeJSchorah
Sep 12 2017 20:01
I'm definitely going to learn the nitty gritty of WordPress. I'm taking this course soon:
I just want to figure out marketing first
piteto
@piteto
Sep 12 2017 20:02
Nice! I learned a lot about wordpress by setting up a $5/month VPS and destroying my own website way too many times lol
Mike
@MikeJSchorah
Sep 12 2017 20:02
The Divi Builder is a drag and drop page builder, but I use CSS for all stylings within it @piteto
lol
piteto
@piteto
Sep 12 2017 20:03
The Divi Builder may be built around modifying the the core theme - would be interesting to see if they actually create a child theme for you
Mike
@MikeJSchorah
Sep 12 2017 20:04
I don't get it anyway. Tried to figure out how to use the child theme. Not working for me... :( @piteto
Guess I need PHP skills to implement it
piteto
@piteto
Sep 12 2017 20:05
It's hard to help without seeing your setup - you usually just log in over ftp, copy/paste the css files you need into a new theme directory, then activate your new theme
no PHP required, just FTP, copy/paste and then editing CSS in a text editor
alright, back to pomodoro madness
Mike
@MikeJSchorah
Sep 12 2017 20:10
I used FTP before. It was a headache. I'm using the child theme from https://github.com/kary4/divituts/wiki/divi-child-theme @piteto
Thanks @piteto
CamperBot
@camperbot
Sep 12 2017 20:10
mikejschorah sends brownie points to @piteto :sparkles: :thumbsup: :sparkles:
:cookie: 100 | @piteto |http://www.freecodecamp.com/piteto
Marko Rajkovic
@marko88ks
Sep 12 2017 21:06
why my text goes to the top of the page , instead they sholud go under my background image?? pls help !!!
html: http://prntscr.com/gkehxt
css: http://prntscr.com/gkeic0
https://prnt.sc/gkegh3
Christopher McCormack
@cmccormack
Sep 12 2017 21:08
@marko88ks you're position is absolute for your .img class
Marko Rajkovic
@marko88ks
Sep 12 2017 21:09
@cmccormack they only show the background image when I set the absolute position
Christopher McCormack
@cmccormack
Sep 12 2017 21:09
@marko88ks if you're going to do that, you need to set thetop:property to a number, or just use position: relative
Marko Rajkovic
@marko88ks
Sep 12 2017 21:11
@cmccormack i try and that but wont work , i dont know what is the problem !
Christopher McCormack
@cmccormack
Sep 12 2017 21:13
@marko88ks that may be because body doesn't have a size, try setting the actual width of the img class to something and see if it works relative.
@marko88ks Maybe something like this? https://codepen.io/cmccormack/pen/GMRvEw
Christopher McCormack
@cmccormack
Sep 12 2017 21:18
@marko88ks I built a container that's absolute and put the picture and text within it, relative
Jay Vora
@jayvora92
Sep 12 2017 21:20
hello everyone i want to hash the email address that submit on form. Does anyone kno the best resource for MD5 script where i can add the current JS variable which grabs the email address from form
Marko Rajkovic
@marko88ks
Sep 12 2017 21:20
@cmccormack ok , I will right away try that .. thanks
CamperBot
@camperbot
Sep 12 2017 21:20
marko88ks sends brownie points to @cmccormack :sparkles: :thumbsup: :sparkles:
:star2: 1211 | @cmccormack |http://www.freecodecamp.com/cmccormack
Christopher McCormack
@cmccormack
Sep 12 2017 21:21
@marko88ks np
Marko Rajkovic
@marko88ks
Sep 12 2017 21:24
@cmccormack now my hamburger icon not work , maybe is that a problem at first place with hamburger icon??
Christopher McCormack
@cmccormack
Sep 12 2017 21:29
@marko88ks you're going to have to try and work stuff out - only you know the design, you'll have to work your pieces into that design. I've updated my pen slightly to show the text Menu in the top right by simply adding a div nested within the #bg div
@marko88ks be aware I've never made a page with this layout so I'm shooting from the hip :D
Marko Rajkovic
@marko88ks
Sep 12 2017 21:31
@cmccormack ok , thanks anyway :)
CamperBot
@camperbot
Sep 12 2017 21:31
marko88ks sends brownie points to @cmccormack :sparkles: :thumbsup: :sparkles:
api offline
Daniel Feldman
@Feldbot
Sep 12 2017 22:40
Hi, I'm trying to understand my Wikipedia search button function. I tried building one like the demo, where the search field expands when it has focus. Somehow because of this it is taking two clicks to engage the button behavior. Also, I'm not sure if I built the button itself correctly. I wanted just the fa-search icon to be clickable, but I couldn't figure out how to do that without the button tag. https://codepen.io/Feldbot/pen/JyQzVL
iso
@iso1048
Sep 12 2017 23:18
@Feldbot seems to be working as expected for me...
Daniel Feldman
@Feldbot
Sep 12 2017 23:20
@gothamknight It works if you hit enter with a query, but if you try to hit the magnifier button to enter a query it first causes focus to be lost and the search box shrinks, then if you click it again it fires off the search. Is that not happening in your browser?
iso
@iso1048
Sep 12 2017 23:24
@Feldbot for me, if i click the magnifier button, the search occurs on the console and the input filed shrinks - I do not need to click twice.
Daniel Feldman
@Feldbot
Sep 12 2017 23:25
@gothamknight Okay, that is good info! What browser are you using. I'm on Chrome for Mac here.
iso
@iso1048
Sep 12 2017 23:25
chrome on windows 10
Daniel Feldman
@Feldbot
Sep 12 2017 23:29
Thanks for checking it out @gothamknight , much appreciated. I'm pretty sure I've written some buggy code too.
CamperBot
@camperbot
Sep 12 2017 23:29
feldbot sends brownie points to @gothamknight :sparkles: :thumbsup: :sparkles:
:cookie: 426 | @gothamknight |http://www.freecodecamp.com/gothamknight
piteto
@piteto
Sep 12 2017 23:44
@Feldbot Remove focus from the button and put it back in the input?
  $("#submit").blur();
  $("#query").focus();
Also, use keyup instead of keypress - the keypress event fires on keydown and keyup. keydown can fire multiple times depending keyboard repeat settings
(in some browsers anyway)
iso
@iso1048
Sep 12 2017 23:46
@piteto in what situations would you use keypress event?
piteto
@piteto
Sep 12 2017 23:47
I'm not sure @gothamknight
Daniel Feldman
@Feldbot
Sep 12 2017 23:56
@piteto Where would you put those functions? I tried them and it didn't seem to do anything. Am I doing something wrong with nesting the icon in the button tag? I find it odd that there is clickable button area that is bigger than the icon, and both are clickable. In Chrome it is showing a gray background on the button, and on Firefox I've got no background, and on hover it doesn't change color. This seems suspect how I might have built the button/submit function itself...
piteto
@piteto
Sep 12 2017 23:57
@Feldbot At the top of your wikisearch() function. I didn't play around a lot with it, but depending on the styling, you may also want to attach a click handler to the icon in addition to the button.
$('#search, #search i).on('click', function() {});