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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T04:29:38+00:00 2026-05-31T04:29:38+00:00

I have a function which is return a object. in the object i have

  • 0

I have a function which is return a object. in the object i have two function to show the popup and close it. it works within the parent function, but it’s not from out side.. is it not a right way to call that.. else how can i call the obj function from out side?

my function :

var popupHandler = function(handler,msg,popUp){

    msg =  msg == "help" ? "help" : "results"
    $(handler).click(function(){
        popObj.showPop(); //works
    })
    $('.cls-how2play').click(function(){
        if(msg == 'help') popObj.closePop(); //works
    });

    var popObj = {
        showPop  : function(){
                    if(!(popUp).is(':visible')) $(popUp).fadeIn().children().find('.'+msg).show().siblings().hide();
                },
        closePop : function(){
                    $(popUp).fadeOut()
                }
    }
    return popObj;
}

from calling ouside like this :

 $('.ui-footer').click( function(){ 
  var closeIt = popupHandler(); 
  closeIt.popObj.closePop() }) //not works.. why?
}

any one can help me the right way to call the obj functions from outside of the returning function?

thanks.

  • 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-31T04:29:39+00:00Added an answer on May 31, 2026 at 4:29 am

    As you are returning the popObj, your closeId will get only the two functions, not wrapped in the popObj object. Therefor you will call the function like so, without popObj:

    closeIt.closePop();
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a function which returns 3 numbers, e.g.: def numbers(): return 1,2,3 usually
I have a function to create a pdf which should return bitarray. Below is
I have a function which returns a one-sided intersection of values between two input
I have a function that needs to return two strings. I've considered two different
I have a function which takes two current class level member variables and sets
I have this function which returns a datatype InetAddress[] public InetAddress [] lookupAllHostAddr(String host)
If I have a function which returns a reference cursor for a query, how
Say, i have a function which returns a reference and i want to make
i have a c function which returns a long double . i'd like to
i have a php function which returns a random json encoded color <?php function

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.