Sorry guys, didn’t know how to word this one.
Still learning jquery and have searched for the answer but haven’t found anything.
When declaring this variable I would like to add these two parts together but I don’t know how.
var link = $'page.html' + (this).attr('rel');
That is my attempt but obviously it doesn’t work.
I’m trying to make the variable read “page.html rel > *”
So it will always be referencing the page but then I can store different div id’s in the rel and pass them to .load()
Thanks in advanced!
If I’m understanding you correctly, you’re quite close:
That will wrap a jQuery instance around
this(I’m guessing this is in an event handler function?), retrieve therelattribute from that element, and put'page.html 'in front of it and' > *'after it. So ifrelis"#foo", you’d end up withpage.html #foo > *.If the
relwon’t have the#, be sure to add it, e.g.:I’m not sure you really want the
' > *'part, though, if you’re going to use this withload.