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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T09:48:56+00:00 2026-05-27T09:48:56+00:00

Im new to Javascript and jquery and I almost have my problem solved. I

  • 0

Im new to Javascript and jquery and I almost have my problem solved. I built an accordion menu that in some versions of IE is bad, I mean, Im sure its bad overall, but it stops all Javascript on the page from working if its called first. Im guessing its some syntax thing I dont know and therefore cant find.

// JavaScript Document

function initiateMenu() {
var pathname = window.location;
console.log( window.location.pathname );

$('.sub').hide();
$("#menu a[href='"+pathname+"']").next().show();
$("#menu a[href='"+pathname+"']").parents('.sub').show();
$("ul.sub").parent().prepend("<span></span>");

$('#menu li span').click(
  function() {
    var checkElement = $(this).parent().find("ul.sub");

    if((checkElement.is('ul')) && (checkElement.is(':visible'))) {
      return false;
      }

    if((checkElement.is('ul')) && (!checkElement.is(':visible'))) {
      $('#menu ul:visible').slideUp('normal');
      checkElement.slideDown('normal');
      return false;
      }
    }
  );
}

$(document).ready(function() {initiateMenu();});

I cant see what is wrong with the script but its stopping all other Javascript from working.

If i call it after other scripts on the page the other scripts work. Please help
If you need to look at the page its http://www.jardencustom.com/2012/

The home page has the accordion script moved below the other scripts, the rest do not.

  • 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-27T09:48:57+00:00Added an answer on May 27, 2026 at 9:48 am

    get rid of this:

    console.log( window.location.pathname );
    

    IE doesn’t support console and will break if you use it.

    check out this SO question and answer:
    What happened to console.log in IE8?

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

Sidebar

Related Questions

I'm pretty new to javascript and jquery, and have run into a problem that
I'm new to javascript/jquery and I've done some poking around the web, but I
jQuery and JavaScript in general are new ground for me. What are some good
I have just started learning Jquery and am new to writing javascript (I am
I'm kind of new to JavaScript and jQuery and now I'm facing a problem:
I'm fairly new to JavaScript/jQuery/AJAX, so I suspect the issue is some typo I'm
I'm fairly new to Javascript/JQuery. I'm trying to write an app that takes text
Still new to Javascript and JQuery. I have a div with a div .
I'm new in jquery/javascript and couldn't google for any solution. I have number of
New to javascript/jquery and having a hard time with using this or $(this) to

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.