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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T09:57:07+00:00 2026-05-16T09:57:07+00:00

as usual i come here after testing around for hours and not having any

  • 0

as usual i come here after testing around for hours and not having any clue what i am doing wrong 😉 I am not an javascript expert so i suppose this will cause some rolling eyes 😉 Sorry about that. I am now at a point where i tried to code somehting in a more readable way. Seperating functions in classes etc… What i want to achieve is something like this:


modules.create(‘streamModule’,’leftColumn’)
which will call
streamModule.create()


NOW THE THING I DONT GET TO WORK:
Calling modules.create(‘streamModule’,’leftColumn’) always results in
Reference Error: leftColumn is not defined???
The id in the call: eval(type +”.create(“+id+”,”+target”)”); is always passed correctly but the target parameter is not??? What am i doing wrong?

Any help would be very very appreciated!!!!! Thank you!

var modules = {
    _map    : [],

    create: function(type,target) {

    if(type == undefined) return false;
    if(target == undefined) return false;

    //Store id in map
    this._map.push(id = createID());

    //Call create function of module
    eval(type +".create("+id+","+target")");
    }
}

[…]

var streamModule = {

create: function() {
    $.log(target)
   }
}

[…]

modules.create('streamModule','leftColumn') 
  • 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-16T09:57:07+00:00Added an answer on May 16, 2026 at 9:57 am

    Why do you need eval at all?

    var modules = {
        _map    : [],
    
        create: function(type,target) {
    
        if(type == undefined) return false;
        if(target == undefined) return false;
    
        //Store id in map
        this._map.push(id = createID());
    
        //Call create function of module
        type.create(id, target);
    }
    

    […]

    var streamModule = {
    
       create: function(id, target) {
        $.log(target)
       }
    }
    

    […]

    modules.create(streamModule, leftColumn);
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Not sure if this is the usual sort of question that gets asked around
I have searched all the usual but come up empty. I must be doing
Is it usual to use a Dialog as main Windows? So without registering any
I'm new to Lua programming, having come over from python to basically make a
When I come across a broken RSS feed, the usual reason its all blown
The Improved pngnq source archive does not come with a makefile (careful when unpacking,
I am using C# having come from a Java background - I have an
The usual way to resolve lnk involve using WShell.WshShortcut or IShellLink that way :
The usual alpha symbol for regular expressions \w in the .NET Framework matches alphanumeric
The usual way to assign color box functionality on a link is like this:

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.