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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T06:40:57+00:00 2026-05-28T06:40:57+00:00

So I have the following piece of code: var structures = { loginStructure :

  • 0

So I have the following piece of code:

var structures = {

    loginStructure : function(){

        return structure = [
            '<form name="',opts.formClass,'" class="',opts.formClass,'" method="post" action="#">',
                '<fieldset class="',opts.fieldsWrapper,'">',
                    '<fieldset class="',opts.userWrapper,'">',
                        '<label for="',opts.userInt,'" class="',opts.userLbl,'"><img src="',opts.userIcon,'" alt="',opts.userName,'" /></label>',
                        '<input type="text" name="',opts.userInt,'" class="',opts.userInt,'" placeholder="',checkNameLenght(opts.userName,namesLenght.userNameLenght,16,'Username'),'" value="" autocomplete="off" />',
                    '</fieldset>',
                    '<fieldset class="',opts.passWrapper,'">',
                        '<label for="',opts.passInt,'" class="',opts.passLbl,'"><img src="',opts.passIcon,'" alt="',opts.passName,'" /></label>',
                        '<input type="password" name="',opts.passInt,'" class="',opts.passInt,'" placeholder="',checkNameLenght(opts.passName,namesLenght.passNameLenght,16,'Password'),'" value="" autocomplete="off" />',
                    '</fieldset>',
                    '<fieldset class="',opts.btnWrapper,'">',
                        '<button type="submit" name="',opts.btnInt,'" class="',opts.btnInt,'">',checkNameLenght(opts.btnName,namesLenght.btnNameLenght,7,'Login'),'</button>',
                    '</fieldset>',
                '</fieldset>',
                '<div class="toogle-button">',
                    '<ul class="inside">',
                        '<li class="toogle"><a><img src="assets/gfx/toogle.png" alt="Back" /></a></li>',
                    '</ul>',
                '</div>',
            '</form>',
            '<div class="toogle-buttons">',
            '</div>'
        ];
    }

}

This returns ( if I do console.log(structures.loginStructure) ) just a function(). Is there a way I can make it to return the actual array I have in there ?

The purpose of it would be to have multiple arrays defined as object keys, if it is possible to return such a thing, because it seems easier. Or is there a better way to do this ?

  • 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-28T06:40:58+00:00Added an answer on May 28, 2026 at 6:40 am

    You want:

    structures.loginStructure();
    

    structures.loginStructure is simply just returning a reference to the function, instead of executing the function and returning its result. Add the () to the end of it to execute it and return its result.

    Alternatively, and maybe better, don’t write it as a function. Just declare loginStructure: ['<form name.... Basically, just remove function(){return structure =. A significant difference to note here is that any values of opts would be evaluated immediately, instead of deferred until later when then function would be executed – so please don’t blindly update your code to this.

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

Sidebar

Related Questions

I have the following piece of code: function checkAmount() { var PayField = document.getElementById('paymentamount');
Say you have the following piece of code: function someProcess() { var deferred =
I have the following piece of code: var blah = function(x, y){ var e
I have the following piece of code which accepts only number form keyboard, function
I have the following piece of code: // setup the AJAX request var pageRequest
I have the following piece of code in Visual C++ 2005 : : class
I have the following piece of code in my DataModel.cs class: public User ValidateUser(string
I have the following piece of code from a book. There is this function
I have the following piece of code: jQuery.fn.shake = function(intShakes, intDistance, intDuration) { this.each(function()
i have encountered the following curious piece of code: function foo(){ works = {hello:world};

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.