CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 7 of 7

Threaded View

  1. #7
    Join Date
    May 2002
    Posts
    10,943

    Re: Javascript: $ Symbol Meaning

    The $ (dollar sign) is a custom function. It is not for regex, nor does it have anything to do with PHP.

    It was created a few years back to make the process of finding/getting elements much simpler. Take a look at this post from my website. It clarifies this well.

    Code:
    (statement) ? true : false;
    This is known as ternary logic. Nice and simple. It takes an if statement to one line and makes the processing much faster.

    Quote Originally Posted by code?
    How would I type up a static class in javascript, So I could easily write...
    Let's make this much simpler...try using objects. They go hand in hand with classes.

    Code:
    var myObject = {
      myFunction = function(str) {
        alert(str);
      },
    
      myRandomVariable: 'Hello world!'
    }
    
    // then to call it
    myObject.myFunction('Hello world!');
    Last edited by PeejAvery; August 11th, 2008 at 08:03 AM.
    If the post was helpful...Rate it! Remember to use [code] or [php] tags.

Posting Permissions

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





Click Here to Expand Forum to Full Width

Featured