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

  • Home
  • SEARCH
  • 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 9114717
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T04:15:46+00:00 2026-06-17T04:15:46+00:00

I have and accordion working on a normal html page, but when I try

  • 0

I have and accordion working on a normal html page, but when I try and add it to a Spring MVC page then I get the error: $(...).accordion is not a function.

Here is the header of my WEB-INF\views\index.jspfile:

<!DOCTYPE html>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<html>
         <head>
  <title>Jeeni Software Ltd</title>
  <link rel="shortcut icon" href="favicon.ico" type="image/x-icon" />
  <link rel="stylesheet" href="<c:url value="css/style.css"/>" type="text/css"> 
  <link rel="stylesheet" href="<c:url value="css/menu/menu_style.css"/>" type="text/css"/>
  <script type="text/javascript" src="<c:url value="js/jquery-1.8.3.js"/>"></script>
  <script type="text/javascript" src="<c:url value="js/jquery-ui-1.9.2.js">"></script>       
  <script type="text/javascript" src="<c:url value="js/jquery.flip.js"/>"></script>

...
<!-- This is the 'accordion' div -->
<div id="accordion" style="height:800px;">
   <h3>Title...</h3>
   ...

Here is the ready function:

$(document).ready(function() {

  var object = $("#accordion");
  alert("object: "  + object.accordion);

  $("#accordion").accordion({ collapsible: true, active: 'false', autoHeight: false });
  $("#banner").fadeIn(1000);

  alert("Done");
});

with this alert("object: " + object.accordion); show object: undefined and it bombs out on the next line.

Here is my servlet-context.xml file

<mvc:resources mapping="/cv/**" location="/cv/" />
<mvc:resources mapping="/wow/**" location="/wow/" />
<mvc:resources mapping="/css/**" location="/css/" />
<mvc:resources mapping="/imgs/**" location="/imgs/" />
<mvc:resources mapping="/js/**" location="/js/" />
<mvc:resources mapping="/inc/**" location="/inc/" />
<mvc:resources mapping="/article-imgs/**" location="/article-imgs/" />

<bean class="org.springframework.web.servlet.view.InternalResourceViewResolver">
  <property name="viewClass" value="org.springframework.web.servlet.view.JstlView"/>
  <property name="prefix" value="/WEB-INF/views/"/>
  <property name="suffix" value=".jsp"/>
</bean>

Firebug shows no problem loading any of the jquery files. I can re-create the proper behavior outside of Spring mvc, so the problem must be something to do with Spring/Java?!? But I can not find out what. The only error Firebug reports is the $(...).accordion is not a function, but everything is setup just like on the jquery ui accordion example.

BTW, I’ve trawled the internet for the last 3 hours and found similar problems that were fixed by typos. This isn’t a typo error. I can not find anything like this regarding jquery UI and Spring MVC.

  • 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-17T04:15:47+00:00Added an answer on June 17, 2026 at 4:15 am

    Solved!

    The problem was that I was importing some content via:

    <jsp:include page="../includes/index_page_intro_txt.jsp" />
    

    and this JSP file was re-importing jquery. Took this out and everything was fine.

    Special thanks to @NimChimpsky for being a sounding board and keeping me going.

    There’s no way anyone could have solved this with the information above. So just let you all know how I solved it:

    I started by removing everything from the file other than the library imports, the ready statement and the accordion div block. Then it worked. So I slowly added everything back until it stopped working and then investigated that cause.

    Should have done that in the first place – duh!

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

Sidebar

Related Questions

I have an accordion menu working on the page, but when I click one
I have a problem with an accordion not working when receiving contents from another
I'm have problems with the jquery accordion not working in joomla with shape5 template.
I have a simple accordion menu working using jQuery but I'm having trouble styling
Ok an have an accordion, but i am not using jQuery UI. This is
I have a jquery accordion style menu that I'd like to add some shortcut
I have a jQuery accordion from this site and edited for my purposes, but
I have pydbgr working well now in Emacs 23.2 with virtualenv . But I
I'm currently working on a project where I have an Accordion control on the
i have done an Accordion style jQuery function which works lovely, but would like

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.