SitePoint Sponsor

User Tag List

Results 1 to 3 of 3

Hybrid View

  1. #1
    SitePoint Zealot
    Join Date
    Aug 2011
    Location
    Trinidad and Tobago
    Posts
    194
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Executing a Function within an object

    I have a strange issue currently within my event.state I have a function that I would like to execute. So you can say that event.state = function(). How I now execute this function that is stored in event.state?

  2. #2
    SitePoint Addict sdleihssirhc's Avatar
    Join Date
    Feb 2009
    Posts
    387
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    Very simple:

    Code JavaScript:
    event.state = function () {
        alert('hello, world');
    };
     
    event.state(); // alerts "hello, world"
    I'm the web overlord for Graphic Business Systems

  3. #3
    SitePoint Zealot
    Join Date
    Aug 2011
    Location
    Trinidad and Tobago
    Posts
    194
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by sdleihssirhc View Post
    Very simple:

    Code JavaScript:
    event.state = function () {
        alert('hello, world');
    };
     
    event.state(); // alerts "hello, world"
    awesome will give it a go


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •