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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 10, 20262026-05-10T23:37:08+00:00 2026-05-10T23:37:08+00:00

I am currently trying to manipulate a unordered list with jQuery, essentially I have

  • 0

I am currently trying to manipulate a unordered list with jQuery, essentially I have a list of links in an unordered list, certain users only have access (all set server side) to certain files / pages.

I was hoping to use some jQuery to remove a few list items from the DOM, simply because it’s more appealing to me to not have the user click on a link, load the page and then be displayed an error because they have insufficient access.

I already have an object setup, and have successfully removed one standalone link from the DOM, although I can’t seem to get the selector right to remove the list items.

List HTML:

<div id='browse' class='bubble'>  <blockquote> <ul id='browses'> <li><a href='browse.php?id=15' class='browse'>Access</a><br /></li> //trying to remove <li><a href='browse.php?id=1' class='browse'>Accounts</a><br /></li> //trying to remove <li><a href='browse.php?id=2' class='browse'>Browse's</a><br /></li> //trying to remove <li><a href='browse.php?id=7' class='browse'>Commands</a><br /></li> //trying to remove <li><a href='browse.php?id=4' class='browse'>Content</a><br /></li> <li><a href='browse.php?id=8' class='browse'>Logs</a><br /></li> <li><a href='browse.php?id=10' class='browse'>Sessions</a><br /></li> <li><a href='browse.php?id=11' class='browse'>Settings</a><br /></li> //trying to remove <li><a href='browse.php?id=12' class='browse'>Sites</a><br /></li> //trying to remove </ul>    </blockquote> <cite>Browse and manage the currently active sites data</cite> </div> 

Object thus far:

Session = function(){     this.init(phpdev_session); }  $.extend(Session.prototype, {     // object variables     vars: '',      init: function(phpdev_session){         // do initialization here         this.vars = phpdev_session;     },      restrict: function() {         if (this.vars.account_class == '40') {             //access client or less, remove manage another site link and a few browses from #browse ul             //note: its all restricted server side, so its just a presentation layer.             $('a#activate').remove();             $('#browses').remove('li:eq(0)').remove('li:eq(1)').remove('li:eq(2)').remove('li:eq(3)').remove('li:eq(7)').remove('li:eq(8)');         }     } });  $(document).ready(function() {     var session = new Session(phpdev_session);     session.restrict(); }); 
  • 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. 2026-05-10T23:37:09+00:00Added an answer on May 10, 2026 at 11:37 pm

    I don’t think jQuery is the right tool for this (I would do it server-side), but I would add a class server-side to the items they don’t have access to, then just do

    $('.noAccess').remove(); 

    If you’re going to do that though, just remove them server-side since you’ll have the code in place.

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

Sidebar

Related Questions

I'm currently trying to write a disassembler. I found the following list of opcodes
I'm currently trying to build a filter search function using JQuery and Ajax. The
I'm trying to use jQuery inside a Firefox extension, and actually want to use
Im currently trying to move my site from localhost on my machine to my
I'm currently trying to learn Ruby and I'm trying to understand more about what
I'm currently trying to write some Javascript to loop through the elements in a
I'm currently trying to implement a StopWatch class. The interface is something like: interface
I'm currently trying to check if the response I'm getting is empty. Now what
I am currently using phonegap and trying to display results from a sqlite table
I currently trying to use an Object Relational Mapper for CodeIgniter and I'm experiencing

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.