Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8090749
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T19:49:31+00:00 2026-06-05T19:49:31+00:00

Sorry guys, didn’t know how to word this one. Still learning jquery and have

  • 0

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!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-05T19:49:33+00:00Added an answer on June 5, 2026 at 7:49 pm

    If I’m understanding you correctly, you’re quite close:

    var link = 'page.html ' + $(this).attr('rel') + ' > *';
    

    That will wrap a jQuery instance around this (I’m guessing this is in an event handler function?), retrieve the rel attribute from that element, and put 'page.html ' in front of it and ' > *' after it. So if rel is "#foo", you’d end up with page.html #foo > *.

    If the rel won’t have the #, be sure to add it, e.g.:

    var link = 'page.html #' + $(this).attr('rel') + ' > *';
    

    I’m not sure you really want the ' > *' part, though, if you’re going to use this with load.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Sorry for the wall of text guys but this one requires expliaining, way too
Sorry guys, not being lazy, I know others have had the same error message
guys sorry for being so noob but im still starting yet with my php,
I know that title didn't make sense, Im sorry! Its hard to word what
Sorry guys, I'm a noob. I know that some languages support type casting, but
Sorry guys, I hate asking dumb questions but I have seriously been searching for
im sorry if this has already been covered, i have had a look but
Edit: Sorry guys, but I wasn't seeing this behavior when I came into work
Sorry guys if this is a lame question, but the examples i found dont
Sorry guys, if this is a stupid question. I have a set of integers

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.