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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T20:48:15+00:00 2026-06-04T20:48:15+00:00

I have a plugin and within it I have a public function ($fn.myplugin.mypublicfunct). My

  • 0

I have a plugin and within it I have a public function ($fn.myplugin.mypublicfunct). My intention is to have mypublicfunct called from a separate .ajaxSuccess outside of myplugin. Thus the want for a public function.

Scenario: myplugin does its thing…form submit via Ajax is different plugin…when that plugin does its .ajaxSuccess I want to call mypublicfunct but be able to use the user options / defaults from myplugin.

Does that make sense? Am I asking the right question the right way?

I tried putting

var opts = $.extend({}, $.fn.myplug.defaults, options);

within the public function and got an error for options not defined (or similar). I’m Google searching up a storm looking for an example, solution, etc. and still I got nuttin’.

  • 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-04T20:48:16+00:00Added an answer on June 4, 2026 at 8:48 pm

    I’ll qualify this first by saying that I’m a relative newbie to jQuery plug-in development. Further, this is something I have struggled with myself, so it’s a +1 from me for a good question.

    What I have tended to do is store my options object on the data property of the selected element (name-spaced with the plugin name):

    var data = {
        options: options,
        otherData: otherData
    };
    
    $(this).data('myPlugin', data);   
    

    The object is then accessible in the public function like so:

    var options = $(this).data('myPlugin').options;    
    

    It feels a bit clunky but it does the job.

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

Sidebar

Related Questions

I have an SVN externals folder which contains many folders called *Plugin then within
I using the Rails resource_controller plugin. I have a ReleasesController, which is nested within
I have this plugin advImage which I use in tinyMce. I want the user
I have an application with plugin-like structure. all application forms inherit from a base
I have the Spring STS plugin activated within my Eclipse project. Doing this enabled
I've got a following problem: I have configured a ant plugin within my pom.xml
Using jQuery UI , I have a tabs plugin and within tab 1 gets
Is there a way to change the defaults within a plugin after they have
I have this plugin in the plugins directory within the admin module directory. So,
I Have a plugin that should run on delete of a custom entity that

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.