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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T17:28:53+00:00 2026-06-11T17:28:53+00:00

I am ready to pull my hair out trying to debug this code. I

  • 0

I am ready to pull my hair out trying to debug this code. I have a page that needs to show numerous sub-posts in the same page without going to another page, however I cannot get the code to work but I cannot find anything wrong. I have even deleted it completely and re-wrote it from scratch to try to find the error but nothing and as always javascript is horrible in pointing the error out to me. I have tried firebug, jslint and made the same structure in jsfiddle but I cannot find the problem. I will say that the same code worked fine in jsfiddle but nowhere else. I see that the page is loading jquery correctly so the api is not the issue. Please help, I do not know what else to do!

Here is the code structure:

HTML-Post Nav

<ul id="sub_select">
  <li class="select">
   <a href="#post1">Post 1</a>
  </li>
  <li class="select">
   <a href="#post2">Post 2</a>
  </li>
</ul>

HTML-Posts

<div id="post1" class="about_txt">
  <div class="title">
    <h1>Post 1</h1>
  </div>
  <div class="desc">
    <p>The post itself</p>
  </div>
</div>
<div id="post2" class="about_txt" style="display: none;">
  <div class="title">
    <h1>Post 2</h1>
  </div>
  <div class="desc">
    <p>The post itself</p>
  </div>
</div>

jQuery script 🙁

$(document).ready(function() {
    $(".select a").click(function(event){
        event.preventDefault();
        $(".about_txt").hide('slow');
        var toShow = $(this).attr('href');
        $(toShow).show('slow');
    });​
});

UPDATE: I’ve added the $ that I apparently forgot to copy, but thanks for pointing this out. I still have the issue though.

  • 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-11T17:28:55+00:00Added an answer on June 11, 2026 at 5:28 pm

    There appears to be an “invisible” character at the end of this code:

    $(".select a").click(function(event){
        event.preventDefault();
        $(".about_txt").hide('slow');
        var toShow = $(this).attr('href');
        $(toShow).show('slow');
    });​  //<= There's an invisible character here, 
         //    you can try pressing backspace once at the end of the semicolon
    

    For quick fix, delete the invisible character OR copy&paste the following code and replace yours:

    $(document).ready(function() {
        $(".select a").click(function(event){
            event.preventDefault();
            $(".about_txt").hide('slow');
            var toShow = $(this).attr('href');
            $(toShow).show('slow');
        });
    });
    

    Edit: A bit of investigation shows that the invisible character is ZERO WIDTH SPACE (U+200B)

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

Sidebar

Related Questions

I'm ready to pull my hair out... This works perfectly: $link = mysql_connect('localhost', 'prototype_wp_usr',
I need help...I don't have much hair left to pull out. I use Eclipse
Sorry if this has been covered, but I about to pull my hair out.
I have this code: $(document).ready(function() { var url = https://graph.facebook.com/search?q=cinema&type=post; $.ajax({ type: POST, url:
I'm about ready to pull my hair out. I've built a new app but
I have two strings that I need to pull data out of but can't
I have the following code to pull some data from an external source: $(document).ready(function(){
I have read and read and read.. I am trying to pull a feed
This seems like the simplest thing in the world and I'm ready to pull
I am trying to pull text from another page (ajaxuseradd.psp) which is in JSON

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.