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

  • Home
  • SEARCH
  • 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 8430405
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T05:35:17+00:00 2026-06-10T05:35:17+00:00

ok so i built a dynamic content swapping system using mootools for my website

  • 0

ok so i built a dynamic content swapping system using mootools for my website and I’m having trouble with one aspect about it. When it pulls the new content off the server it also gets a snippet of code which is to be executed by the Type Function

    setContent: function(content) {
    var self = this;
    window.history.pushState({x: 0}, "x", content[0].toLowerCase());
    var mainField = $('meat');
    mainField.set('html', content[1]);
    if(content[2] != false) {
        var functionn = Function(content[2]);
        functionn();
    }
},

Now in this situation im trying to execute a method in the class:

addLink: function(item) {
    var self = this;
    var object = $(item);
    self.menus.include(item);
    object.addEvent('click', function(event) {
        event.stop();
    });
},

by sending this to the set content method to be executed:

self.addLink('#order');

now when I try it out i get this error:

Uncaught TypeError: Object [object Window] has no method 'addLink'
  • 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-10T05:35:18+00:00Added an answer on June 10, 2026 at 5:35 am

    I guess self refers to window rather than to your class, see the example at http://mootools.net/docs/core/Types/Function#Function:bind. Use bind() to bind this to your class and then use this in your server reply.

    if(content[2] != false) {
        var functionn = Function(content[2]);
        var functionn_bound = functionn.bind(this);
        functionn_bound();
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying to create a dynamic grid using ExtJS. The grid is built and
I'm trying to have the built in jQuery widgets apply to dynamic content, for
I built a pretty basic dynamic AJAX function to load in content onto the
I'm in need of a dynamic form that will be built from a list
I'm using JBoss AS 7.1 and Hibernate in Eclipse 3.7.2 to build a Dynamic
Alright, here is the output I get: arm-none-linux-gnueabi-ld --entry=main -dynamic-linker=/system/bin/linker -rpath-link=/home/oem/android-ndk-r3/build/platforms/android-5/arch-arm/usr/lib -L/home/oem/android-ndk-r3/build/platforms/android-5/arch-arm/usr/lib -nostdlib -lstdc++
Has anyone tried to build an e-commerce site atop MS Dynamics, using the new
I have an ASP.net page with dynamic content that are inside Controls, some of
My company (an engineering firm) is looking to redesign their website with some dynamic
(Revised for content quality) We had built forms based application for a customer based

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.