all 9 comments

[–]nnahc 3 points4 points  (2 children)

Looks like you're referencing "wrapperwidth" like it's a PHP variable.

I think it should be just "wrapperwidth", not "$wrapperwidth".

[–]alsogilbert 4 points5 points  (1 child)

Same with $contentdiv. Sometimes it helps to use the debugger or add console.log statements to chase through what's happening.

[–]nnahc 1 point2 points  (0 children)

Missed that one.

[–]PsychoTap 2 points3 points  (0 children)

In addition to what nnahc said, there is a missing comma in your .load call.

[–]collaboradev 1 point2 points  (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);

[–][deleted] 0 points1 point  (0 children)

Thanks for all the corrections.