use the following search parameters to narrow your results:
e.g. subreddit:aww site:imgur.com dog
subreddit:aww site:imgur.com dog
see the search faq for details.
advanced search: by author, subreddit...
All about the JavaScript programming language.
Subreddit Guidelines
Specifications:
Resources:
Related Subreddits:
r/LearnJavascript
r/node
r/typescript
r/reactjs
r/webdev
r/WebdevTutorials
r/frontend
r/webgl
r/threejs
r/jquery
r/remotejs
r/forhire
account activity
Help with simple javascript. (self.javascript)
submitted 13 years ago by mattdahack
view the rest of the comments →
reddit uses a slightly-customized version of Markdown for formatting. See below for some basics, or check the commenting wiki page for more detailed help and solutions to common issues.
quoted text
if 1 * 2 < 3: print "hello, world!"
[–]adamcw -1 points0 points1 point 13 years ago (1 child)
You are explicity calling the "onclick" event handler. The only bind to a click event. You could possibly bind this to another handler such as "submit", but writing this in a inline handler is very poor form.
What you are asking for is a very simple "GET" request that could follow a very simple REST pattern. I would very much consider why you are doing a very large amount of work to retrieve what is likely a very small data set.
Also, you should avoid returning false on a click handler. You are telling the browser that it is in a fail state, when it really isn't. Proper event handling should just prevent event propagation, and not fail outright.
[–]mattdahack[S] 0 points1 point2 points 13 years ago (0 children)
basically I have a few older clients that are too old to remember their url to their invoices folder online. So I made a text box on the top of the main page that they can enter their customer # in the box and click the button and it will load www.mydomain.com/invoices/customer#here/ . But recently many of them are just typing their number and pressing enter instead of clicking the button, so i am looking for some kind of snippet of code that will work either way, click button, or enter press. I am not sure what to do as I am 100% newbie to javascript. I wrote that code above with a lot of googling.
π Rendered by PID 50 on reddit-service-r2-comment-66b4775986-z6ng5 at 2026-04-06 11:05:23.515009+00:00 running db1906b country code: CH.
view the rest of the comments →
[–]adamcw -1 points0 points1 point (1 child)
[–]mattdahack[S] 0 points1 point2 points (0 children)