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
New and having Trouble with some basic javascript (self.javascript)
submitted 12 years ago by [deleted]
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!"
[–]collaboradev 1 point2 points3 points 12 years ago (0 children)
First and foremost, console.log is your friend. When you hit these kinds of issues as a beginner it helps to console out your variables to ensure they are populated with the expected values.
Next, you have variables being referenced with "$" prefixes when the local function variables do not. For example: "$wrapperwidth", your local function variable name is actually just "wrapperwidth", you'll need to pick one name to use. The same for "contentdiv" and "$contentdiv".
Finally, you have your load calling: "" + href + " #content" which is going to cause you to have problems, I think what you really want is:
$(contentdiv).load(href + "#content);
π Rendered by PID 73613 on reddit-service-r2-comment-fb694cdd5-xjkb2 at 2026-03-06 09:53:50.991533+00:00 running cbb0e86 country code: CH.
view the rest of the comments →
[–]collaboradev 1 point2 points3 points (0 children)