Hot answers tagged

2 votes

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

JavaScript $.get is asynchronous. It triggers an HTTP request and returns. The code meant to prevent submission runs after submission is processed, and therefore can't prevent it. The preventDefault ...
Blauelf's user avatar
  • 20.9k
2 votes

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

.focus(handler) is short for .on("focus", handler), and installs an event listener, in your case, handler is an anonymous function declared with one parameter. Those handlers, when called, receive an ...
Blauelf's user avatar
  • 20.9k
1 vote
Accepted

Why I can't make one event handler to three elements with its ID? [JQuery]

Use semicolon wherever you mean it. Your IIFE is interpreted as a function call, like some_expression // missing semicolon here leads to misinterpretation (function(){ /* do something */ }());
Blauelf's user avatar
  • 20.9k
1 vote
Accepted

How to make a "div" clickable using Jquery

[UPDATE 18/07/2017] Instead use: $("main").on("click", ".delete", function() { (this).closest(".card").remove(); }); The issue is associated with the creation of dynamic elements. The jQuery ...
Tokoeka's user avatar
  • 26
1 vote
Accepted

Stuck on final project

Assume grid size 3 and hyp_board 0 | 0 | -1 0 | 0 | 0 1 | 0 | 1 The first "check each row" loop will return 1 as the winner. Won't it? "On paper" from i = 2: first_node = hyp_board[2]...
DinoCoderSaurus's user avatar
1 vote

Final project: How to submit form without going to another page with Ajax/jquery?

The return value of a successful $mysqli->query involving INSERT is true (it does not return an object), so you can test for this and echo a corresponding message.
ronga's user avatar
  • 1,415
1 vote
Accepted

jQuery syntax help

It is an object method. See getJSON api doc especially The jqXHR Object section. This article on jQuery chaining explains why it looks like the methods are "not attached to an object".
DinoCoderSaurus's user avatar

Only top scored, non community-wiki answers of a minimum length are eligible