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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T18:17:21+00:00 2026-06-05T18:17:21+00:00

I have added a plugin called scrollpaper to a site I’m working on. The

  • 0

I have added a plugin called scrollpaper to a site I’m working on. The plugin is used on both static pages, and on html snippets I append to the site.

The problem is, when the appended snippets which call the function are removed, using:

$(this).remove();

I get the following error relating to the scrollpaper plugin:

TypeError: 'undefined' is not an object (evaluating 'data.clearer')

The error occurs the moment the snippets are removed. It doesn’t cause any actual performance problems, and the plugin is still successfully called and executed when I re-append the snippets, but the errors do stack up, and I’d very much like to fix them.

The main plugin file is included at the foot of every page, with a call made for the static pages added below it:

<script src="js/jquery.scrollbarpaper.js"></script>
<script type="text/javascript">
$(function() {
    $('.scrollpaper-trigger').scrollbarPaper();
});
</script>

A second call is added to the appended html:

<script>
$(function() {
    $('.scrollpaper-trigger-lightbox').scrollbarPaper();
});
</script>

How To Recreate The Problem:

  1. Open web inspector/fire bug
  2. Launch either the full, party, set menu or the reserve online form
  3. Either close the opened element by clicking on the overlay/close button, or switch between the menus at the bottom of the menu page.
  4. This will trigger the error

To fix the problem myself, I’ve so far tried only adding the base plugin file to the appended elements (and ignoring the static pages), I’ve also tried using .html('') and .empty(''). In place of .remove(), but that hasn’t helped.

I’ve only been working with JQuery for a couple of months, so whilst I’m becoming familiar with how it all works, and I’m keen to learn best practices. However, this problem is beyond me at present, so any and all help would be hugely appreciated.

Menu Flipping Script:

$('.other-menus a').click(function() {
var url = $(this).attr('data-url'); 

$('.switch').fadeOut(500,
function() {
$(this).detach();
$('<div></div>').load(url).fadeIn(800).appendTo('.switch-wrap');

})

});
  • 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-05T18:17:23+00:00Added an answer on June 5, 2026 at 6:17 pm

    You’re removing the element from the DOM using .remove, but this will clear all .data items, including the object stored at the "scrollPaper" key. The scrollpaper plugin is accessing properties on the object retrieved from .data("scrollPaper"), so when it starts returning undefined it throws an exception.

    You want .detach instead in scripts.js:

    $(this).detach(); //Removes Element From DOM
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have this jQuery plugin called Easy Slider which I'm implementing on this site
I am using jquery validation plugin for form validation. I have added a custom
I have added wicked_pdf plugin in my rails applications to generate pdf. It works
I have added a custom file selector plugin for FCKeditor and inserting of a
I need some help: I have three separate JQM pages - page1.html, page2.html and
For example I have this gem called Authlogic-openid, that plugin is outdated, no longer
I have an existing site that is working well with Authlogic login. I'm trying
I've recently added the JQuery autocomplete plug in and have a textbox that autocompletes
I have added Output Caching to a couple of actions in my app for
I have added widget functionality to my app, which is compatible with older versions

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.