Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Activity
  • Aug 17 09:32
    User @bjorno43 unbanned @linkin-park
  • Jun 20 21:19
    @bjorno43 banned @shenerd140
  • Apr 25 17:13
    @mstellaluna banned @cmal
  • Jan 08 22:05
    @mstellaluna banned @dertiuss323
  • Nov 07 2018 04:42
    User @texas2010 unbanned @ows-ali
  • Nov 02 2018 16:25
    @texas2010 banned @ows-ali
  • Oct 12 2018 05:50
    @bjorno43 banned @NACH74
  • Oct 05 2018 23:02
    @mstellaluna banned @JomoPipi
  • Sep 16 2018 12:21
    @bjorno43 banned @yash-kedia
  • Sep 16 2018 12:16
    @bjorno43 banned @vnikifirov
  • Sep 05 2018 08:12
    User @bjorno43 unbanned @androuino
  • Sep 05 2018 07:38
    @bjorno43 banned @androuino
  • Aug 23 2018 16:57
    User @bjorno43 unbanned @rahuldkjain
  • Aug 23 2018 16:23
    @bjorno43 banned @rahuldkjain
  • Jul 29 2018 14:13
    User @bjorno43 unbanned @jkyereh
  • Jul 29 2018 01:00
    @bjorno43 banned @jkyereh
  • Jul 10 2018 22:09
    @bjorno43 banned @manafn
  • Jul 06 2018 15:20
    @texas2010 banned @imlegend19
  • Jul 03 2018 12:28
    @bjorno43 banned @vbvmatta
  • Jun 29 2018 13:54
    @bjorno43 banned @OGTechnoBoy
BrianWilliams28
@BrianWilliams28
i suppose that could work
Daniel Simeonov
@dbsimeonov
One of my interviews for a Junior position was exactly that. Creating a page only with JS and animations for changing positions
Nicolas Ramirez
@kamatheuska
@Hussein90 did you manage to solve your issue?
greetings!
AJ Brommy
@AJ-Brommy
@BrianWilliams28 nice profile photo :)
BrianWilliams28
@BrianWilliams28
@AJ-Brommy thanks lol
Eric Weiss
@eweiss17
@dbsimeonov sounds awesome, did you complete it?
Daniel Simeonov
@dbsimeonov
Yes but on the interview I was not impressed with their developers and took the offer from another company
Hussein Zaki
@Hussein90
i have a little problem @all
Hussein Zaki
@Hussein90
this is my little project todo list on table
it is working very good
but the little problem is the tasks under the personal category not starting from beginning like work category
Dany Din
@danydin
hey
what's wrong here?
<script>
  document.addEventListener('DOMContentLoader', function(){
    document.getElementById('getMessage').onClick=function(){};
  });
</script>
Christopher McCormack
@cmccormack
@danydin I believe it's onclick not onClick unless using React or another library that has it's own events
Dany Din
@danydin
@cmccormack oh ya but still it says: // running tests
Your code should add an onclick event handler.
// tests completed
but i followed exactly as instructed
you want the link maybe to the challenge ? @cmccormack
Christopher McCormack
@cmccormack
@danydin can you link the exercise?
:)
Christopher McCormack
@cmccormack
thanks
@danydin did you change it to onclick? worked for me
Dany Din
@danydin
ya still not working
<script>
  document.addEventListener('DOMContentLoader', function(){
    document.getElementById('getMessage').onclick=function(){};
  });
</script>
this? ^
@cmccormack
Aditya
@ezioda004
@danydin Its DOMContentLoaded not DOMContentLoader
Christopher McCormack
@cmccormack
@danydin that should have already been configured, did you change it?
Dany Din
@danydin
ahh fcl this shit thanks you too @cmccormack @ezioda004
BrianWilliams28
@BrianWilliams28
how can i set the content of my 3 list items here in pure JS?

let navEl = document.createElement("nav");
let brandEl = document.createElement("div");
let brandTag = document.createElement("a");
let navLinksEl = document.createElement("ul");
let liEls = document.createElement("li");
navLinksEl.className = "nav-links";
navLinksEl.appendChild(liEls);
navLinksEl.appendChild(liEls);
navLinksEl.appendChild(liEls);

brandTag.href="#";
brandEl.className = "brand";
let titleEl = document.createTextNode("Javascript Page");
document.body.appendChild(navEl).appendChild(brandEl).appendChild(brandTag).appendChild(titleEl);
navEl.appendChild(navLinksEl);
br3ntor
@br3ntor
for (let i = 0; i < 3; i++) {
  let liEls = document.createElement("li");
  liEls.textContent = i;
  navLinksEl.appendChild(liEls);
}
Something like this maybe?
Liam Wears
@lwears
@AJ-Brommy Thanks for checking. Sorry for the delay in responding. It was just me having tired eyes / brain!
Eric Weiss
@eweiss17
@BrianWilliams28 if you are used to using jquery, there is a jquery to base js converter
Fernando L. Estuesta
@champolot
Is there any one here could explain why I get an error on this code
Daniel Simeonov
@dbsimeonov
Send it and we will try to help you
Fernando L. Estuesta
@champolot
UI.prototype.showAlert=function(message,class name)
It says classname is not declared but it's value is never read
Eric Weiss
@eweiss17
can u give the relevant code snippets
Fernando L. Estuesta
@champolot
Sorry for the typo on my code. That's className
BrianWilliams28
@BrianWilliams28
@br3ntor yeah but I want each LI to have different content xD
Fernando L. Estuesta
@champolot

heres the full code

function Book(title, author, isbn) {
this.title = title;
this.author = author;
this.isbn = isbn;
}

function UI() {}

UI.prototype.addBookToList = function(book) {
const list = document.getElementById('book-list');
const row = document.createElement('tr');
row.innerHTML = <td>${book.title}</td> <td>${book.author}</td> <td>${book.isbn}</td> <td><a href="#" class="delete">X </a></td>;
list.appendChild(row);
};

UI.prototype.showAlert = function(message, className) {};

UI.prototype.clearFields = function() {
document.getElementById('title').value = '';
document.getElementById('author').value = '';
document.getElementById('isbn').value = '';
};

document.getElementById('book-form').addEventListener('submit', function(e) {
const title = document.getElementById('title').value,
author = document.getElementById('author').value,
isbn = document.getElementById('isbn').value;

const book = new Book(title, author, isbn);

const ui = new UI();

if (title === '' || author === '' || isbn === '') {
ui.showAlert('Please fill all', 'error');
} else {
ui.addBookToList(book);
ui.clearFields();
}

e.preventDefault();
});

xDDD
Daniel Simeonov
@dbsimeonov
What error gives you, className not defined? Did you try to register it and writing some output in the function instead being empty?
Im not expert with prototype functions but never seen that approach :D
Fernando L. Estuesta
@champolot
any thing that is inside the function
Markus Kiili
@Masd925
@champolot You have commas at the ends of lines there const title = document.getElementById('title').value,. Should they be semicolons?
Daniel Simeonov
@dbsimeonov
I think that was a way to assign multiple variables like he did ?
Markus Kiili
@Masd925
oh yes, you are right. Missed the const there.