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 3321100
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 17, 20262026-05-17T23:01:20+00:00 2026-05-17T23:01:20+00:00

I think that I am on the right track but I need your help.

  • 0

I think that I am on the right track but I need your help.

I use this code to get my URL parameter

 function $urlParam(name){ 
    if(window.location.href.indexOf(name) != -1) {
        var results = new RegExp('[\\?&]' + name + '=([^&#]*)').exec(window.location.href); 
        return results[1] || 0; 
    }
    return 0;

} 


$(function() {
var $page='#'+$urlParam('id');

 });

And than I tried to filter that data with

$side_menu.find('> li > a').filter($page).click();

But this doesn’t work.

Is there anything that I can do so I can filter data with $page variable?

If you need any more data I would be glad to provide it to you.

Thank you in advance,
Prokka

  • 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-05-17T23:01:21+00:00Added an answer on May 17, 2026 at 11:01 pm

    Ok, first off, instead of:

    window.location.href

    you might as well use:

    window.location.search

    as that is just the parameter part of the URL (the part you want). Also, your variable:

    $page

    … the “$foo” variable naming convention is usually meant to be applied to jQuery object variables. In other words:

    var foo = "foo";
    var $foo = $(foo);

    So (unless you have your own, different convention) I think “$page” should really be named page .

    As for:

    $side_menu.find('> li > a').filter($page).click();

    I can’t tell for sure, but it looks like you’re filtering on an id. Is that correct? If so, filter makes no sense; IDs are by definition unique on the page, so simply doing:

    $($page).click();

    is totally the same thing (even performance-wise).

    But this doesn’t work.
    Is there anything that I can do so I can filter data with $page variable?

    Without knowing the value of your page variable it’s hard to say. I’d suggest adding this:

    console.log($page);
    $side_menu.find('> li > a').filter($page).click();

    Well, if you’re using Firebug or a browser with a console (if not … you should be using Firebug 😉 but you could also just change it to “alert($page)”).

    When you do that, you should see what selector you’re really using. Most likely something is wrong with it. If you don’t see anything obvious, try adding:

    console.log($page); console.log($($page));
    $side_menu.find('> li > a').filter($page).click();

    (the alert trick won’t work for this one). This should show you what elements (if any) jQuery selected using your selector. Between this and reviewing the selector itself, you’ll likely find the problem (and if you don’t, maybe try playing around with running the commands in the Firebug console manually)

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

Sidebar

Related Questions

I think that some newer languages like JS can do this natively, but I
Ok, guys, I think that's the right place to ask a question, because it's
I think that handlers in android are tools to get different objects that are
I think that this problem can be sorted using reflection (a technology which I'm
Not sure if this question makes for some poor performance down the track, but
I think this is a general Java question, but it does involve some Android
I need some info on this subject. I've searched around a bit but it
I've run into an issue that I need clearer heads to think through. Occasionally
I do not think this is a duplicate. I have done some reading but
I think what I need is CROSS APPLY, but I can't seem to figure

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.