Questions tagged [javascript]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
0
votes
0answers
17 views

Deploying Final Project to a Server - CS50W

I'm trying to deploy my Final Project to a server, where you can access it through a url instead of always using the runserver command in the terminal. However, it has a SQL database (Django) with ...
0
votes
1answer
40 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
0answers
11 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
1answer
19 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
108 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
0answers
8 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
12 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
29 views

Facing issues while trying to Post HTML form contents to views.py route using fetch method POST in javascript

Hello I am trying to post information i get from a form to an API that submits it to the views.py file in Django. Can anyone tell me where i am going wrong. Below is my javascript code ...
0
votes
0answers
18 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 ...
0
votes
0answers
12 views

Final Project ajax issue

Hi I'm working on my final project, an online two player game based on the cs5o Finace distribution code, I got tic-tac-toe to work and am now trying to update the playing field displayed to the user ...
0
votes
0answers
10 views

CS50w flack (chat) project: channel user list stops updating after a while, can't understand why

This is a weird one, so I've recorded a short video to better illustrate the problem. As an additional feature to my chat app I have a panel on the right that displays the users currently on the ...
0
votes
0answers
15 views

Bubble sort not working

Bublesort <p id= "notiz">Hello World!</p> <script> document.getElementById("notiz").innerHTML = "The results of Bubblesort:<br>"; var mannschaft = ["Leander", "...
0
votes
0answers
11 views

JS: How to interact with new HTML element created with javascipt?

I am learning javascript with the cs50w course. As part of Project2 I am developing a chat app, and my issue raises when I try to add new elements to a list of chat rooms, see them, and interact with ...
0
votes
0answers
79 views

Why I get a MultiValueDictKeyError when getting data from POST request?

I'm currently learning in Django, and in this fetch request, I always get the same error: topup.html let data = new FormData(); data.append('amount', document.getElementById(...
0
votes
0answers
17 views

Unable to get the username from html to javascript

I'm trying to get the user enter a username and access that value from a separate js file. No matter what method I try it doesn't work. If I run the script from within the html file then I'm able to ...
0
votes
0answers
37 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
429 views

cs50 finance register function

Could someone please explain how the script code works in register.html if a username is already taken in the database? Basically, if the username exists, i don't want to pass the 'apology' function, ...
0
votes
0answers
141 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
1answer
15 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
0answers
18 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
81 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
85 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
144 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
590 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
347 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
87 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 ...
2
votes
1answer
174 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
1answer
27 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
41 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
476 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
22 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
19 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() { ...
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
635 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 ...
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 ...
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
35 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
70 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 ...
1
vote
1answer
251 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
44 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 ...
0
votes
1answer
405 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 ...
0
votes
1answer
358 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 ...
1
vote
1answer
282 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
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
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 ...
1
vote
1answer
213 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 ...
2
votes
1answer
345 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
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 ...