Reputation:
how can I concatenate the second line:
var newLink = $(this).attr("id")
$("section").load( newLink + "section > *"); // this is not working
newLink is the variable and "section > *" is the selector.thx
Upvotes: 1
Views: 48
Reputation: 193261
You need to put space before "section", otherwise CSS selector is incorrect (assuming that there is child section
tag within whatever tag newLink
points to):
var newLink = $(this).attr("id")
$("section").load(newLink + " section > *");
Note, that you might want to prepend newLink with #
if you want ID selector.
Upvotes: 1