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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T14:15:58+00:00 2026-06-09T14:15:58+00:00

A js/css template is provided to me. It is very talented in interactive event

  • 0

A js/css template is provided to me.
It is very talented in interactive event handling, but i am not talented on js/jquery.

In its js library, there is a .js file,
and the file has some code like:

(function ($) {
...
})(jQuery);

most of thing happens in it.

There are some “little independent functions” in this upper function.

And some lines in this upper/wrapper/non-named function, call these “little-independent functions”.

Also, i want to call these “little independent functions” BUT i could not find out how.

Because in the lines in “(function ($) {...})(jQuery);” those call these “little independent functions” there are some local variables.

I think some code help me to tell:

(function ($) {

if(...){
var items;

addItem(items)
}

function addItem(funcitems){}
...
})(jQuery);

My question is that, how can i call additem, how can i pass “items” into it?

I want to call it in a custom part of my page after a custom event.

  • 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-09T14:15:59+00:00Added an answer on June 9, 2026 at 2:15 pm

    You have two options to achieve this:

    1) Add your code into this anonymous function, so that your code is in the same scope like these encapsulated functions. (Not so good since you are compromising the library)

    2) Make a variable assignment and add a return-statement with the functions you need: (better, since you dont mix the library code with your own and just expose a few of the functions)

    var extLib = (function ($) {
       ...
       return{
          /* return the functions you need - written in object literal notation */
          addItem : addItem
          /*[,exposedName : internalName] */
       }
    })(jQuery);
    

    Now you can access the addItem function by calling extLib.addItem(item).

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

Sidebar

Related Questions

In this link: http://css-tricks.com/snippets/jquery/jquery-plugin-template/ it has a line of code that says // Add
I'm trying to add .css and .js file in my HTML template files that
I have a template in joomla without index.php I only have index.html, css file,
Ok since I'm not good with css, I am using a free css template
How do i reference a file template.css from index.php . This file is located
I'm looking at a css template that includes .myClass a.extra{...} and .myClass a.extra:hover{...} What
I have template in which a button is created with a link using css,
i'm writing an email template and was told to use only inline css (because
I have some css files that i need to use in RTL direction template.
For a responsive template, I have a media query in my CSS: @media screen

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.