Questions tagged [javascript]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
0
votes
2answers
278 views

Mail CS50 Web - How to Send Email (API not working)

I'm very new to Javascript and working on mail, project 3 for CS50 web. I've been working on just sending the email initially, for about a week and I'm getting very discouraged. I can't seem to get ...
0
votes
1answer
264 views

CS50w / Project 3 - Mail / Inbox showing duplicates

I'm currently on Project 3 in CS50 Web and pretty much completed it. However, there seems to be a bug in unarchiving emails. Whenever I click the unarchive button and it reloads the Inbox, there seems ...
0
votes
1answer
96 views

cs50web socketio : broadcast does not include the sender

I work on ubuntu 18.04. I set up a virtual environment so that I am sure to work with python3 according to the instructions found here:https://vitux.com/install-python3-on-ubuntu-and-set-up-a-virtual-...
0
votes
1answer
147 views

pset7 survey - for loop to give alerts not working properly, why not?

I can't figure out what's wrong with my for loop, written in Javascript. It isn't functioning as needed. 1- It only sometimes gives the javascript alert message saying "Please make sure you have ...
0
votes
1answer
16 views

Stuck on custom validation

I am trying to do the check part of the assignment in Finance via Bootstrap validation but I am failing miserably trying to understand how it works at all. https://getbootstrap.com/docs/4.1/components/...
0
votes
1answer
21 views

What is the purpose of using anonymous functions within other functions?

What is the purpose of putting addMarketMethod() within an anonymous function in this example? function drop() { for (var i =0; i < markerArray.length; i++) { setTimeout(function() { ...
3
votes
1answer
63 views

Google Earth frame is displayed in front of javascript alerts

When I click start engine in the right rail of the application, an alert is displayed behind the Google Earth frame of the Harvard Yard. I cannot click on any items that are displayed on this alert, ...
0
votes
1answer
37 views

JS Dropdown in final project

My final project is a conversion website. I am trying to make a dropdown menu that when you click one of the options in the DD, you are taken to another page. When I put in the following code (from ...
0
votes
1answer
48 views

Final Project: Using data in SQL to modify HTML of web page?

I am not sure if this is the right place to ask for help with my final project or if I should use a more general programming forum, but hopefully you guys can help me out. How do you modify the HTML ...
0
votes
1answer
82 views

javascript not running in pset7 survey

I finished form in html. I wrote script below form in script in body. It is not having any syntax errors (hopefully). entire script is a single function called validate() which returns true or false ...
0
votes
1answer
25 views

Trivia | Uncaught TypeError: correct.addEventListner is not a function

Inside the script tag there was a error: Uncaught TypeError: correct.addEventListner is not a function at HTMLDocument. (index.html:14) Please help me fix it here's the code: var correct = document....
0
votes
1answer
189 views

Pset8 addMarker Help Needed (search textbox also not working)

I'm trying to do addMarker() on Problem Set 8. I've got one marker showing on the map with a label, but that's it. I can't figure out how to show all of the markers that should go on the map at a ...
0
votes
1answer
203 views

pset8 addMarker() - Problem displaying <ul> in the google maps textbox

I'm having a hard time figuring out why my function doesn't show the unordered list in the marker's info box but instead it does display "[object HTMLUListElement]". console.log(list) confirms that ...
1
vote
1answer
291 views

CS50 Final Project: Dropdown Menu / Typeaheads

For my final project (a website where people can write diaries and read others' diaries), I am trying to implementing a search box where the user may search usernames to read others' diaries, so I ...
0
votes
1answer
156 views

CS50W Project 4 / Network - like counter not always saving to database

I was able to implement a like counter where it keeps track of all the likes. For some reason though, it randomly doesn't save the counter to the database when I submit the PUT request. I can't figure ...
0
votes
1answer
178 views

How to fix if statements within event listeners in Javascript

I'm struggling to spot the error in my javascript code in pset8. Specifically the code doesn't execute as I'd expect when using an if statement within an event listener. I've tried talking to the duck,...
0
votes
1answer
26 views

Finance - trouble implementing javascript

I am trying to set up my index page so that each stock in the user's portfolio has buttons to buy and sell said stock. The first step is working so far. Each row in the index table has buy and sell ...
0
votes
1answer
377 views

Calling a javascript function from flask

For my final project, I am creating a flask web mapping application, which with user input displays different things on a map. At the moment, when they input a place name via a form, my python ...
0
votes
0answers
14 views

Project: My “copy to clipboard” functionality works fine on my PC but not on iPhone or iPad :( Any ideas?

I'm doing my final project for CS50 and I have a html page which creates a list of items using a "for" loop, and a button below it which has a "copy to clipboard" function. It all ...
0
votes
0answers
121 views

Mail Project 3 CS50W - Cannot Send Mail

I am stuck on CS50W's Project 3 Mail. I'm very new to JavaScript so I think I'm probably missing something obvious but I cannot get it to send an email. When I go to the admin section there's nothing ...
0
votes
0answers
24 views

Parsing Error: Unexpected token in Javascript

For my final project I'm implementing a simple chrome extension in Javascript but I keep getting the error "Parsing Error: Unexpected Token :" However I copied this example code directly ...
0
votes
0answers
41 views

JavaScript functionalities not applied when JavaScript code written in an external .js file for a flask application

I'm working on project2 of CS50's web programming using python and javascript. I've made a .htm file and I need to write some javascript code for the page. I first wrote the code in an external file ...
0
votes
1answer
15 views

how to autofit a webpage to any screen size

I am pursuing web track for pset8. I am using fixed number instead of percentages for size of each element. How can I make sure that the webpage can fit to all screen / window sizes without getting ...
0
votes
0answers
19 views

Final Project: dynamic page creation to show just 10 SQL entries per page

I'm developing a web-page for my CS50's Final Project for contacting japanese students around Argentina. The only official japanese exam takes place in Buenos Aires, and there are no many good places ...
2
votes
1answer
237 views

How to integrate handlebars(written in raw javascript) into django templates

Please, I'm still rather new to handlebars templating, my handlebars template works perfectly with just html files, but when I try to render the page containing the handlebars template, I get all sort ...
0
votes
0answers
39 views

can't fetch value from frontend… “document.querySelector('#text').value;” not working

<html> <head> <script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/socket.io/2.3.0/socket.io.js"></script> <script src="http://ajax.googleapis....
0
votes
0answers
165 views

PSET8 CS50 Finance: /Check fails to run, does not catch or notify of duplicate usernames

I have been struggling with the check function in PSET8 for a few weeks now, and have run into various problems as I tried to work through my issues. Currently, it seems by check .get function does ...
0
votes
0answers
19 views

Very Basic JS Troubles!

I don't know why this is proving so difficult but over two hours of googling has not solved my problem! My code is below. I have create a very simple set of mutually exclusive radio buttons. What I ...
0
votes
1answer
631 views

CS50 Pset8 Finance /check - TypeError: The view function did not return a valid response

I've got most of finance working but I can't for the life of me sort out /check. No matter what I do, I get the error: 'TypeError: The view function did not return a valid response. The function ...
2
votes
1answer
378 views

CS50 Finance: Register unique username (/check) problem: pythion GET function not working

I am working on the new /check additional on the Finance problem. I am trying to prevent the register form from being submitted when the username is already taken, is empty, or is just one character. ...
0
votes
0answers
88 views

Issue with CS50W's Project2 - submitted text not passed to chat window

I have a problem regarding passing posted messages into the proper field and presenting them to the user. The app is supposed to transfer the text submitted in "messenger" into the "messages" so to ...
0
votes
1answer
23 views

PSET8 invalid sw.

When I am trying to use the search bar, the autofill just gives me " , , " and when I click on that suggestion the console tells me "invalid sw". After reasearching the problem a bit, everyone seems ...
0
votes
1answer
28 views

Mashup: javascript variable doesn't retain value

I am trying to implement addMarkers function and calling "/articles" endpoint to get JSON data. However, while creating infoWindow javascript variable loses value. function addMarker(place) { var ...
0
votes
1answer
644 views

Access just the text from a db.execute return

Evening all. I am working on my final project and have a question about db.execute. When I run my SQL search the return always has the format {"key": value}. Is there any way to then extract the ...
0
votes
1answer
291 views

pset8 2018 mashup search

I have changed nothing in the pset8 distribution code and only implemented search function and formatted configure in script.js, but no suggestion shows up from the search box 'q'. This worked ...
0
votes
1answer
35 views

Javascript 'Undefined' Variable

I am trying to import values for coordinates using getJson however the map doesn't load now and if I try to print the coordinates in an alert box for testing purposes, it says 'undefined'. // get ...
0
votes
1answer
1k views

Send Variable from Javascript to Flask Application

In a Javascript file scripts.js, how do you send a variable called place which contains information about a place (e.g. name, location, rating) to a Flask Python application.py.
0
votes
1answer
679 views

Google Maps Places API Code Not Running - Final Project

I am quite far into my final project and needed either a database or software which would return places when given a keyword and an area as input. E.g. Restaurants in London. I tried using the ...
0
votes
0answers
37 views

Map not appearing

I implemented the configure() function. It worked for a few days but after that the map did not appear. There is only the search textbox which also doesn't work now. When I check the javascript ...
1
vote
1answer
43 views

What purpose does “eventData” serve in the pset8 source code “$(”#q“).focus(function(eventData)”?

I have read the jQuery documentation on .focus() as per the pset8 instructions. However, I still do not fully understand the code below: // hide info window when text box has focus $("#q").focus(...
0
votes
1answer
73 views

How to get info from an asynchronous javascript function into html - help with callback function

For my final project, I am accessing an API, and I want to display data from that API in a web-page (the API provides data on forecast electricity generation from solar PV in the UK, it's provided by ...
0
votes
1answer
47 views

Don't understand why a function accessing an API is not returning a response

I'd appreciate some help with something I'm working on for my final project. I'm trying to create a web-app based on what we had to do for Pset8 - creating a google map that updates with information ...
1
vote
1answer
286 views

How do I cluster markers on a googlemap?

For my final project I'm creating a google map web app - building from what we learned in Pset8. I've got over 1,000 locations to add to my map - which looks pretty crowded, as you can see: I'm ...
0
votes
1answer
406 views

pset8 addMarker - unable to display contents of JSON inside info window

I'm struggling with this part of Pset8. I've written the code to add markers to my map, and to create an info window that opens when I click the marker. I can get a string of content into the window ...
2
votes
1answer
346 views

CS50 Pset8: Info Window Not Showing

I have been working on addMarker() from scripts.js and was stuck at the second half of the prompt. My markers and labels are showing perfectly, however, the info windows are not popping up when I ...
0
votes
1answer
367 views

Final Project Search Suggestions

I'm currently working on my final project, a website. I'm trying to include a search suggestion box (typeahead), similar to that of pset8's. I tried to implement it similar to pset8's, but for some ...
0
votes
1answer
31 views

question on Week 10's video lecture

question on Week 10's lecture at 1:10:49 or so where he runs ajax0.html, correct? Then he goes into his webpage and types in his IP address with :8080/quote?symbol=NFLX and it pops out that script ...
1
vote
0answers
51 views

how can we step through pset8 in debug mode?

So when I run my code in flask I get no infowindows. I wondered what this does in the distribution code: // open info window (if not already open) info.open(map, marker); How can I debug in ...
0
votes
1answer
28 views

CS50 Final Project: Enabling a form button

So in a separate html form, I created a textarea (id: blog) and a button (id: final). I would like to disable that button when the length of the textarea is below 500, and enable it when such a length ...
1
vote
1answer
215 views

CS50 Pset8: Final Questions before Wrap-Up

After pulling multiple allnighters I have finally submitted my last problem set before turning to the final project. I hope someone can shed some light on my last questions in regard to problem set 8 ...