homepage Welcome to WebmasterWorld Guest from 54.237.213.31
register, free tools, login, search, pro membership, help, library, announcements, recent posts, open posts,
Become a Pro Member
Home / Forums Index / Code, Content, and Presentation / JavaScript and AJAX
Forum Library, Charter, Moderator: open

JavaScript and AJAX Forum

    
What does $(string) mean?
jmf314159

5+ Year Member



 
Msg#: 3679 posted 4:21 pm on May 7, 2005 (gmt 0)

I found the following statement in a JavaScript library module:

var elements = document.getElementsByClassName($('class-name').value);

Would someone please explain the $(string) referrence?

Thank you very much.

Jay

 

jollymcfats

10+ Year Member



 
Msg#: 3679 posted 11:10 pm on May 7, 2005 (gmt 0)

You're probably looking at code that uses Prototype [prototype.conio.net], a javascript library. $() is just a function in the library, not special javascript syntax. In simple usage it works like this:

function $(domID) { 
return document.getElementById(domID);
}

(That's not the actual function definition, it's just a simplification.)

jmf314159

5+ Year Member



 
Msg#: 3679 posted 11:20 pm on May 7, 2005 (gmt 0)

Thank you very much!

Global Options:
 top home search open messages active posts  
 

Home / Forums Index / Code, Content, and Presentation / JavaScript and AJAX
rss feed

All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
Home ¦ Free Tools ¦ Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About ¦ Library ¦ Newsletter
WebmasterWorld is a Developer Shed Community owned by Jim Boykin.
© Webmaster World 1996-2014 all rights reserved