Questions tagged [javascript]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
0
votes
1answer
6 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
15 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
16 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
11 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
6 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
12 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
16 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
34 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
181 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
91 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
14 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
0answers
13 views

Is it possible to uniquely identify a client device ?? Maybe using mac address or something similar

I want to make a web-project that would allow the users to use my web-app only in one device at a time. I want to uniquely identify all the devices they registered for my app so that they can be ...
0
votes
1answer
77 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
0answers
38 views

Pset 7 (Survey) - How to validate select dropdown value is not empty from external javascript file?

I have my form and HTML in a file called form.html like so: <div class="form-group row col-sm-2"> <select class="form-control" id="states"> <option selected ...
0
votes
1answer
75 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
142 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
539 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
296 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
136 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
26 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
37 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
291 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
31 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
958 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
608 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
29 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
236 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
41 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
403 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
343 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
258 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
26 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
49 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
212 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
344 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
188 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
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 ...
0
votes
1answer
858 views

CS50 Mashup: addMarker clarification

Been struggling with pset8 for a few days now. I've many problems here but I guess the main one is I'm not seeing my markers properly, not to mention that the infoWindow isn't happening... I've some ...
0
votes
1answer
202 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
votes
1answer
191 views

pset 8: infoWindow is not being updated

guys, The problem I am facing is that after I have created all the markers every time I click on them I see all the same links in infoWindow. Why is it happening? Everything seems to be written just ...