Skip to content

Tag: javascript

Getting A Month’s Worth of Data With KnexJS

I’m trying to get a month’s worth of data using KnexJS, I only have the year and month in the form 20xx-mm. Here’s my Knex query .. The issue is, I’m starting at a specific date and going through to the 31’st day, some months have 30 days, some 28 and 29. How do I go about to cre…

How to do this article scroll animation?

Hi I am trying to do scrolling article animation from bottom to top like in this site link. Help me please. There is my code: (Idk how to do this) I am forgot to show my code I am tried position: fixed use JavaScript with marginTop but don’t worked Answer Check the same effect Click here to view on Code…

React table cell getSelection()

I have a table with an onRowClick handler on the <tr/> element, I want to prevent a click event if I select text inside it, my solution was this: What I found odd is, when I select a text inside a cell, and click on the same cell, the click event is not fired until the selection is cleared, but

Javascript validation works…and fails

I have the following Javascript code in my web page that SHOULD ensure data validation and then (if the form is valid) submit the data to an AJAX call: The problem is, the validation works, but it doesn’t. When the form fields are not valid, it hits this block: and the alert is displayed. The very next …

Javascript and HTML defer tag not working

The Javascript function below works perfectly when at the bottom of html file. However, I need it in main.js file. It has been suggested that adding the defer tag to the script tag will enable this but unfortunately not. It prints the first console.log but then stops. Any suggestions? Answer There are two met…

ReferenceError: color is not defined

I am learning the concepts of Functional Programming and came across an exercise that has me pretty stumped. When I go to Invoke consoleStyler() in Task 4, it gives me a Reference Error: color is not defined. I followed the step by step instructions on the course to get this current code as well as played aro…