r/JavaScriptHelp • • Apr 25 '21

💡 Advice 💡 Need Help with Javascript Assignment (node js and mongoDB/mongoose)

0 Upvotes

I have an assignment for school and I am hitting a lot of roadblocks. If anyone can help me out that would be awesome. DM me if you can.


r/JavaScriptHelp • • Dec 12 '17

I need help in creating Java Script

0 Upvotes

Basically I am creating a puzzle game us html, css, and Java script. In one part of the game you have to enter a code like 4444 or apple and if the user enters the code wrong you lose but if they type 4444 or apple they move on. Now I have never used java script ever because i haven't needed to use it ever but I need it to create this text based game I just don't know how to code it or implement into the html or the screen? If someone code make a template code I could use and tell me how to link it to my html that would be great!


r/JavaScriptHelp • • Dec 13 '17

How is the initialize function undefined?

0 Upvotes

var txtInput;

function initialize() { txtInput = document.getElementById('txtInput'); document.getElementById('btn5').addEventListener('click', numberClick, false);

The initialize function is also called in test.js page using the following:

module('Calculator Test Suite', { setup: function () {initialize(); } });


r/JavaScriptHelp • • Mar 06 '13

Need some advice implementing markdown editor

0 Upvotes

Hi redittors

I'm in need of advice, for developing the markdown feature in my java based web application. In my google search, I have come across pagedown, which seemed to be okay. I didn't integrate it in my application. Are there any pointers to simple example code which uses pagedown? What are all available markdown Implementations available for free & open source other than pagedown? Please share your insight on this. I'd like to rephrase my question, if it's not that straight. Thanks in advance


r/JavaScriptHelp • • Apr 10 '18

SetTimeouthelp!

0 Upvotes

r/JavaScriptHelp • • May 11 '21

❔ Unanswered ❔ I M BAD AT JAVASCRIPT

0 Upvotes

v: I'm bad at JS, someone helps me with my homework it's something super basic but I don't understand it well:, c I have two days on it and it doesn't work out my command says: < Make a Javascript program that when entering a number on the screen it is added by by itself to its lowest value. Ex. 4 4 + 3 + 2 + 1 = 10


r/JavaScriptHelp • • Nov 26 '20

❔ Unanswered ❔ Need Help

0 Upvotes

Noob here. I'm incorporating affectiva JS SDK CameraDetector to track different emotions within the wesbite using the base code attached. I need a way to record and save the canvas as a video while the emotion recognizer is working. https://jsfiddle.net/affectiva/opyh5e8d/

Need this for a school project and deadline is fast approaching. Any help would be appreciated


r/JavaScriptHelp • • Feb 01 '21

❔ Unanswered ❔ JS code question

0 Upvotes

how can i repair this code to make this birthday picker also show options as Select Day, Select Month, Select Year, there is part only in php but also in JS that powers this thing up, here is the link to the code https://gist.github.com/danieltheuser/9fa54704ff01e26de2fd46b20b160783


r/JavaScriptHelp • • Jul 17 '18

JavaScript for adobe extractPages()

0 Upvotes

Is there any way to use extractPages to save the extracted pages as a different file type in adobe?

I have several static ranges that will never change, and need a few as .docx. I tried this.extractPages(nstart,nEnd,’/C/myDirectory/myFilename.docx’, ‘com.adobe.acrobat.docx’); once and it worked fine. Then, my machine froze and I lost it. The converted range is still there though and perfect. Now, when I use the same script it tells my RangeError. In fact, if it doesn’t end in .pdf it always tells me no matter what range is (or isn’t) specified.

Anyone know any way to make that work?


r/JavaScriptHelp • • Nov 20 '21

❔ Unanswered ❔ Error: stuck on loading

1 Upvotes

(https://ibb.co/0QPNBV9) Error message on link


r/JavaScriptHelp • • Jan 18 '21

❔ Unanswered ❔ I can do TCP/IP client<>server, but how do I do Peer to Peer

1 Upvotes

Hello,

I am finalizing a social media sute. I'm able to do tcp/ip, but now I want to do Peer to Peer supplemented so it is hader to shutdown. IS P2P possible with javascript or would a partner program be needed?

Thank you,

Jim


r/JavaScriptHelp • • Dec 28 '20

❔ Unanswered ❔ How do I smoothly transition between ID

2 Upvotes

I want to smoothly transition fun from using card to card_add

<!DOCTYPE html>

<html lang="en"> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <title>Document</title>

<style>
    #card{
        height: 100px;
        width: 100px;
        background-color: red;
    }
    #card_add{
        height: 500px;
        width: 100px;
        background-color: blue;
    }
</style>

</head> <body> <button onclick="fun">yes</button> <div id="card">

</div>

</body> </html>


r/JavaScriptHelp • • 3d ago

r/JavaScriptHelp is available for adoption

2 Upvotes

/r/JavaScriptHelp is ready for a fresh start, new energy, new direction, and someone like you to bring it back to life. If you’ve been thinking about growing your impact without starting from scratch, this is your chance!

Ready to take it over?

Head to r/RedditRequest to submit your request and make it yours before it’s taken.

First things first

To request this subreddit, make sure you:


r/JavaScriptHelp • • Feb 03 '21

❔ Unanswered ❔ Javascript code question

1 Upvotes

Hello, i am not good at javascript and am looking for help so i came here. i have a code where i need to check whether the selected year is leap or not and if yes and it is selected and also february month is selected then to show 29 days, havent been able to solve this problem. hopefully some nice people here will https://gist.github.com/danieltheuser/7bd81647ae980d1d9d6aa58ab46abba8


r/JavaScriptHelp • • Jan 23 '21

❔ Unanswered ❔ Bootstrap 4 modal, handling with JQuery.

2 Upvotes

My code works, but wondering how you all would optimize it? There are two functions, one to catch someone hitting and redirect that to the button click function, and the button click that actually submits the form.

When the form submits, I get a JSON response composed of status (which is either "success" or "failure"), and message, which is the actual error message.

I feel like what I have now is far too many lines of code, and wonder how someone who knows more about what they're doing would do this :)

Here's my pastebin, I'd love to learn a little from you all.

https://pastebin.com/rBKbzKdq


r/JavaScriptHelp • • Feb 06 '21

💡 Advice 💡 Check if the date is in between two dates or equal to the date

1 Upvotes

I have the basic code working, but I am not sure this is the best way to do it and would love some help in finding a way to make the code more manageable.

What I am looking to do:

I would like to set variables for data's and inside of this if statement I will change other variables. But right now, I am only doing a console.log to check if it's working. Seeing that there could end up being tons of days, I am hoping that there is a better way to do this.

var TodaysDateIS = moment().format('MMDD');
// var TodaysDateIS = "0314"; // For Testing Dates
console.log(TodaysDateIS);
var StartOfYear = "0101";
var HollieBirthday = "0130";
var ValentinesDay = "0214";
var AlonsoBirthday = "0314";
var StPatricksDay = "0317";

if (TodaysDateIS > StartOfYear && TodaysDateIS < HollieBirthday || TodaysDateIS == HollieBirthday ){ // Hollie Birthday
console.log("Hollie Birthday");
}else if (TodaysDateIS > HollieBirthday && TodaysDateIS < ValentinesDay || TodaysDateIS == ValentinesDay ){ // VD
console.log("VD");
} else if (TodaysDateIS > ValentinesDay && TodaysDateIS < AlonsoBirthday || TodaysDateIS == AlonsoBirthday ){ // Alonso Birthday
console.log("Alonso Birthday");
}else if (TodaysDateIS > AlonsoBirthday && TodaysDateIS < StPatricksDay || TodaysDateIS == StPatricksDay){ // St. Patrick's Day
console.log("St. Patrick's Day");
}


r/JavaScriptHelp • • Jan 05 '21

❔ Unanswered ❔ How to put correctly url in tag <a> using javascript? blade syntax (laravel)

2 Upvotes

This's my code but it's not working

rows = rows + "<a href='{{ url( 'Logigramme/"+value.id_activite+"') }}'>"+value.nom+"</a>";

can someone show me the correct syntax


r/JavaScriptHelp • • Jan 15 '21

❔ Unanswered ❔ JavaScript Test

1 Upvotes

Hi Guys,

I gave up on trying to solve this test, can you guys help me so I can learn something with this test I did not pass through?

Please complete the following test and send me the code as soon as it's ready.

/* PRINT OUT TO THE CONSOLE,
AN ORDERED LIST OF "ACTIVE" USERS,
BY INCREASING SURNAME (ie A, B, C),
WITH A STRING SHOWING USERS FULL NAME AND AGE TO WHOLE NUMBER
ie

"TOM CAT is 80 years old."
"MICKEY MOUSE is 92 years old."
"JERRY THEMOUSE is 80 years old."
*/

const USERS = [
{ name: 'Troy Barnes', dob: '1989-12-04', active: false },
{ name: 'Abed Nadir', dob: '1979-03-24', active: true },
{ name: 'Jeff Winger', dob: '1974-11-20', active: true },
{ name: 'Pierce Hawthorne', dob: '1944-11-27', active: false },
{ name: 'Annie Edison', dob: '1990-12-19', active: true },
{ name: 'Britta Perry', dob: '1980-10-19', active: true },
{ name: 'Shirley Bennett', dob: '1971-08-12', active: false },
{ name: 'Professor Professorson', dob: '1969-03-27', active: false },
{ name: 'Craig Pelton', dob: '1971-07-15', active: true }
]


r/JavaScriptHelp • • Dec 26 '20

❔ Unanswered ❔ Question about JS versions.

1 Upvotes

I thought to start learning Javascript and found this book in Amazon. Judging by the reviews this is a good book.

[HTML, CSS, and JavaScript All in One: Covering HTML5, CSS3, and ES6, Sams Teach Yourself 3rd Edition, November 30, 2018] (https://www.amazon.com/HTML-JavaScript-Sams-Teach-Yourself/dp/0672338084/ref=mp_s_a_1_1?dchild=1&keywords=HTML%2C+CSS%2C+and+JavaScript+All+in+One%3A+Covering+HTML5%2C+CSS3%2C+and+ES6%2C+Sams+Teach+Yourself+3rd&qid=1608950850&sr=8-1)

But ES6 it seems outdated or I'm wrong? Latest is 11, as wiki says.

My question is should I learn ES6? What is your recommendations? Maybe you know something the similar like this book? I need html and css too. But I worry to learn something outdated cos of lack of time.

Thank you!


r/JavaScriptHelp • • Jan 23 '21

❔ Unanswered ❔ Is anyone able to change the stroke-dasharray using the DOM and console?

1 Upvotes

Hello everyone,

I am trying to change the ring percentage from https://oamstudios.com/default-user/lilapowell/?profiletab=main

document.querySelector("circle.circle-chart__circle").strokeDasharray = "50,100";

I would like that it changes based on the % under Current Progress.

Any help would be very appreciated.


r/JavaScriptHelp • • Jan 16 '21

❔ Unanswered ❔ Help displaying this pattern on screen

1 Upvotes

Hi All

I'm trying to get this pattern to display without the button disappearing. i can get it to display on a new screen, but i need the button to remain.

All help is really appreciated.

<!DOCTYPE html>
<html>
 <head>
 <title>JavaScript Number Patterns</title>
 <script>
 function generatePattern() {
 var num = 16;
var m, n;
 for (m = 1; m < num; m++) {
 for (n = 1; n <= m; n++)
 if (n % 2 === 0) {
 document.getElementById("pattern").innerHTML = "O";
      } else {
 document.getElementById("pattern").innerHTML = "X";
      }
 document.getElementById("pattern").innerHTML = "<br/>";
  }
 for (m = num; m >= 0; m--) {
 for (n = 1; n <= m; n++)
 if (n % 2 === 0) {
 document.getElementById("pattern").innerHTML = "O";
      } else {
 document.getElementById("pattern").innerHTML = "X";
      }
 document.getElementById("pattern").innerHTML = "<br/>";
  }
}
 </script>
 <style>
 

 div {
 display: flex;
 justify-content: center;
}
 </style>
 </head>
 <body>
 <br>
 
 <div>
 <input id="button" type = "button" onclick = "generatePattern()" value = "Generate Pattern"> 
 </div>

 <span id="pattern">
 </span>
 </body>
</html>

r/JavaScriptHelp • • Jan 06 '21

✔️ answered ✔️ I need some help about js

1 Upvotes

Hello im just started to learning javascript and i was doing an example. This is a simple driver's license query algorithm but somethings went wrong idk what is wrong. Btw, I can do this using "if/else" but i want to know what is the problem and how can i do it with using "switch" please help me.

var Birthday = prompt("What is your birthday : ");
var Year = 2021;
var Age = Year - Birthday;
var remtime = 18 - Year; //remaining time

switch(Age){
    case (Age<18):
        console.log("It is "+remtime+" years before you can qualify for a driver's license.");
    break;
    case (Age>=18):
        console.log("You have the right to get a driver's license.");
    break;
    default:
        console.log("Wrong value.");
}

r/JavaScriptHelp • • Jan 05 '21

❔ Unanswered ❔ I can’t seem to figure out why the fetch is responding with an Unhandled Promise Rejection: SyntaxError: The string did not match the expected pattern. It works on another member that I created perfectly.

2 Upvotes

Problem page: https://oamstudios.com/default-user/seeram79/

Working page: https://oamstudios.com/default-user/titus/

Script:

<script> // this is for the .json gathering and implementing if(window.location.pathname.indexOf("/default-user/") == 0) { var account_name = document.getElementsByClassName("um-name")[0].innerText; var urltotal = "https://oamstudios.com/attendance/" + account_name + ".json"; var urlres = encodeURI(urltotal); let myRequest = new Request(urlres); fetch(myRequest) .then(response => response.json()) .then(data => { console.log(data) document.querySelector("#Account-Input-6827").innerHTML = ` <p>Class Credits: ${data["Class Credits"]}</p><p>Excused Absences: ${data["Excused Absences"]} </p><p>Invoice Status: ${data["Invoice Status"]}</p><p id="highlight">Invoice Link: <a href="${data["Invoice Link"]}" style="color: green;" target="_blank">View Invoice</a></p><p>Invoice Number: 00${data["Invoice No."]}</p>` var alarm = 2; var invstat = data["Invoice Status"]; var InvNo = "\r\nInvoice No. " + "00" + data["Invoice No."] + " has not been paid.\r\n\r\n Please make payment."; if(invstat !== "Invoice Paid"){ alert( InvNo ); document.getElementById("highlight").innerHTML = ` Invoice Link: <a href="${data["Invoice Link"]}" style="color: red; background: #FEFFAD;" target="_blank"><strong>PAY INVOICE</strong</a> ` } }); } </script>


r/JavaScriptHelp • • Feb 04 '21

❔ Unanswered ❔ Countup script: how to change separator and decimal parameters

1 Upvotes

Hello, this is my first post. I hope it doesn't get deleted.

I'm completely new to js, so I apologise in advance for my ignorance.

I am working on a website, with a counter in javascript.

It seems to me that the count up counter is coded with "," as separator in the thousands place and "." for decimals.

I'd like to change these separators to just an empty space " " and a "," for decimals.

It looks like I can do that in the code where it specifies separator and decimal parameters.

Will it work to use

separator: ' '

decimal: ','

as parameters?

I've modified the js file, but it appears to not be changing the separator or decimal parameters...

I did give the site a .js.txt file to read because the cms won't take a .js file... The site seems to have rejected the file but instead used the previous file for some reason. I think it's the CMS that does this.

I guess I just want to know normally, if I change these parameters if the script display them as I want?

Thanks in advance!


r/JavaScriptHelp • • Jan 07 '21

✔️ answered ✔️ Need help showing/viewing the contents of a list in a <div>

1 Upvotes

Allow me to bring some context.

I am creating a small barebones website for a school project that allows you to create and view Notes. The html website has already been built and im currently busy writing javascript to make the websites functionalities work. functions i have already implemented is a function that saves the contents of a note in the local storage and a function that loads said Data.

The problem im currently facing is making the function that shows all that data in a <div> (''noteOverview) that I have created within the .html file.

The structure of the app: noteSite.html <- Notes.js <- note.js.

noteSite.html

<body>

<div id = "header">

<div id = "name">Original_projectName</div>

</div>

<div id = "container">

<div id = "write">

<label for="noteTitle">title of the note</label>

<input type="text" id = "noteTitle"/>

<label for="noteBody">body of the note</label>

<textarea id="noteBody"></textarea>

<button id="saveButton">Save</button>

</div>

<div id = "read">

<select size="10" id="noteList"></select>

<div id="noteOverview"></div>

</div>

</div>

<script src="notities.js"></script>

<script src="notitie.js"></script>

</body>

notes.js

let out = ""; //output

//Save functione

document.getElementById( 'saveButton').addEventListener('click', function() {

const noteDate = new Date();

const noteTitle = document.getElementById('notitieTitel').value;

const noteBody = document.getElementById('notitieSchrijfVlak').value;

const theNote = {date: noteDate, title: noteTitle, body: noteBody}

noteSave(theNote);

});

function noteSave(theNote) {

let noteList= JSON.parse(localStorage.getItem('noteData'));

if (noteList== null) {

noteList= new Array();

}

noteList.push(theNote);

localStorage.setItem('noteData', JSON.stringify(noteList));

}

function loadNote() {

//getting notes from lĂŠ localStorage

if(noteList!= null && noteList!="") {

noteList= JSON.parse(localStorage.getItem('noteData'));

for(let x = 0; x < noteList.length; x++) {

out += "<option value=" +x + ">";

out += noteList[x].title;

out += "</option>";

document.getElementById('noteList').innerHTML = out;

}

}

}

Now here were getting to the meat of things. i figured i should show all my code since this would probably make it the easiest to understand it without any misunderstandings about its porpose/how its supposed to work. Just note that this right here is the part im having trouble with:

function showNote() {

//showing the notes withing the 'noteOverview' <div>

noteList= JSON.parse(localStorage.getItem('noteData'));

out += "<h2>" + noteList.title + "</h2>";

out += "<p>" + noteList.body + "</p>";

document.getElementById('noteOverview').innerHTML = out;

}

Note.js

function Note(date, title, body) {

this.date = date;

this.title = title;

this.body = body;

}

I dont actually know much javascript since i dont focus on the webdevelopment side of programming much during my studies. I have been stuck at this part for quite some time now, so any aid would be much appreciated.

TLDR: i want to show all the notes that are saved within the local storage in the 'noteOverview' <div>. and be able to select them using the 'noteList' <select> statement.