Skip to content
View in the app

A better way to browse. Learn more.

Web Designer Forum

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

creating 2 javascript classes that talk to each other.. pretty simple I "think"?

Featured Replies

Hi,

 

Okay, so i have 2 javascript "classes" (or the equivilant, whatever you want to call it).. and I need them to be able to talk to each other, but when I try I get an error... Here is the code:

 

function ArenaProcessing(){
   this.display = "";
   this.init = function(){
        alert ("ArenaProcessing Class Started");
   }
   this.setDisplayModule = function(module){
       this.display = module;
   }
}

function ArenaDisplayControl(){
   this.process = "";
   function init(){
       alert ("ArenaDisplayControl Class Started");
   }
   this.setProcessModule = function(module){
       this.process = module;
   }
}

var ArenaProcess = new ArenaProcessing();
var ArenaDisplay = new ArenaDisplayControl();
ArenaProcess.SetDisplayModule(ArenaDisplay);
ArenaDisplay.SetProcessModule(ArenaProcess);


 

Now in theory I was expecting this to give each class the other ones instance so that they can talk to each other with ease...

 

The problem is with the last 2 lines.. when I try and actually send the instances.. I get this message

 

Object doesn't support this property or method

 

Can anyone help me out here?

 

I have a pretty sound understanding of php classes and have been using them for a good while. Just never looked into the javascript side of them and I'm having a few teething problems.

 

Thanks

  • Author

no matter, it appears that I'm actually just retarded and can't see the difference between a s and S lol...

Create an account or sign in to comment

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.