Questions tagged [javascript]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
4
votes
1answer
3k views

Accessing information from PHPmyadmin using Javscript

I am currently working on my final project and trying to add markers to my Google map using information from a MySQL table. I called this table ideas and the table contains info such as the longitude ...
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, ...
2
votes
1answer
400 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. ...
2
votes
1answer
352 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 ...
2
votes
4answers
313 views

How to use inspect Element to view HTML and CSS of a website?

I was trying to view the html source code or css used in timeslide theme used on blogger.com. I cannot find out what CSS is used for that expansion effect that we click on a time stamp and the topic ...
2
votes
1answer
259 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 ...
2
votes
1answer
75 views

Pset7 How to Program Popup?

I'm trying to create a popup after a user successfully sells a stock. I want it to look like Chrome's confirm form resubmission popup I'm pretty sure I need javascript, html, and css, but I'm not ...
1
vote
1answer
98 views

Why are functions defined where a parameter should go?

I am working on pset8 now, and I am looking at the Google Maps API. In many examples, I find that functions are defined in a way that is really strange to me. google.maps.event.addListener(marker, '...
1
vote
1answer
340 views

pset8 infoWindow appearing with wrong marker

I have everything working with addMarker() except for the fact that the infoWindow pops up in the wrong spot, as in the last marker that was loaded. I found the link below which seems relevant and the ...
1
vote
2answers
123 views

How can I compare the .js files to check if passengers are freshmen?

In pset 8, to check if a passenger is allowed to take the shuttle I must check if the passenger's house (https://shuttle.cs50.net/js/passengers.js) is in the HOUSES array (https://shuttle.cs50.net/js/...
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(...
1
vote
1answer
301 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 ...
1
vote
1answer
217 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 ...
1
vote
1answer
29 views

JS/HTML automatic reloads

I'm using Javascript/HTML/CSS to create a web tool for my final project. The way my page is set up, I have information in a div element on the left side of the page, and an input table on the right ...
1
vote
1answer
809 views

How to edit HTML label text and apply CSS using Javascript?

I'm working on This Problem on the first studio of module 8 in CS50x. Basically I just want edit that label and apply the CSS with Javascript if an error is encountered, but I don't know enough about ...
1
vote
1answer
76 views

jQuery syntax help

In looking through the source code and through examples online, I keep coming across something like: $.getJSON("test.php", parameters) .done(function (data) { // code for success }) While I can ...
1
vote
1answer
427 views

Javascript Timer- Start when Typing Detected

I want to make a js timer that starts when typing is detected in a certain html input box. The timer does not need to be displayed on the webpage, or need to be in js. Preferably it should record in ...
1
vote
1answer
44 views

How to Redirect Only When a User Clicks Ok on a Popup?

I want a JS popup to appear after something is successfully completed. How do I make it appear, and disappear only when the user closes it, then redirect to the next page? By the way this is in a php ...
1
vote
1answer
299 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 ...
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
0answers
59 views

Google Earth plugin becomes blank when debug tool is opened to view console

I'm working on pset8 on a Windows 7 machine with plenty of resources. When I open up the JavaScript Debugger in Chrome to interact with the console, the Harvard Yard displayed in Google Earth goes ...
0
votes
3answers
147 views

What is markup language?

I'm little confused with html, it is said as markup language but what exactly a markup language is and how it is different from programming language and scripting languages. Does it need to be ...
0
votes
1answer
859 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
2answers
2k views

$.getJSON in PSET8 mashup's addMarker function in scripts.js

I am attempting to retrieve the array containing news articles for my marker infoWindow in the addMarker function using the following code snippet: var parameter{ geo: place.postal_code } $....
0
votes
1answer
42 views

Flask Filter Search/List in Python

I created a country list on the python search page section, the data is sent to the Html table with jinja syntax “ The Html table also has a JavaScript function it functions correctly no help with ...
0
votes
1answer
491 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
666 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 ...
0
votes
1answer
32 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
750 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
24 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
698 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
1answer
295 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
371 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
274 views

Objects in javascript

I'm somewhat stuck at pset 8... not really "stuck" stuck as so far my code is working the way it should, but seeing how I am a bit confused in how objects work, I guess I must have been lucky (or ofc ...
0
votes
1answer
93 views

change icon of marker problem in mashup

In add marker function i added the code and all the marker are getting displayed. So i thought lets change the default image of the marker so i added two line //image line 1 and 2 ... please see ...
0
votes
1answer
478 views

pset8 - addMarker/showInfo - Uncaught TypeError: Cannot assign to read only property 'gm_bindings_'

It seems like I am really close to finishing my implementation of addMarker. I'm using markers with labels, I've got the articles loaded into an JSON object, and I've created the content to pass to ...
0
votes
1answer
41 views

How does Canvas data URL WORKS?

Working with HTML5 I came across CANVAS API. So first suppose I draw or render a picture on CANVAS in HTML5 and with little bit JS we get a dataURL of our files which may be used as a permalink across ...
0
votes
2answers
8k views

How to create an HTML button linked to a drop-down menu

I am trying to create an HTML button that allows the user to select an option to submit. My code does indeed create a button with an embedded drop-down menu, but when the user tries to select a ...
0
votes
1answer
70 views

Error when I give a passenger a seat

This is how I am giving a passenger a seat shuttle.seats[i].name = PASSENGERS[i].name; // i is the index you know shuttle.seats[i].house = PASSENGERS[i].house; but it gives me the error ...
0
votes
1answer
954 views

Is window.location.href not enough to get the current url?

In service.js, it employs the follwoing code to get the current url var url = window.location.href.substring(0, (window.location.href.lastIndexOf("/")) + 1); many javascript tutorials on the web ...
0
votes
0answers
23 views

CS50 web network project: like button reloads page and only displays json data instead of the actual webpage

I am working on the cs50 web project network. When the like button is clicked the text in the button should then change to say unlike and the like count should increase by one without reloading the ...
0
votes
1answer
47 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
680 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
2answers
460 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
0answers
161 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
1answer
215 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
28 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
346 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
18 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 ...