PDA

View Full Version : jquery questions on # thingy and json



Rockonmetal
05-28-2009, 07:36 PM
# Thingy
So I wanna make a fancy menu like this


<ul>
<li><a href="#home">Home Sweet Home</a></li>
<li><a href="#documentation?group=1&article=3">Getting Started</a></li>
</ul>
<div class="content">
CLICK A LINK FOO!
</div>

How do I get it in jQuery so that I can use that # thingy to pull up a page on div class content?

JSON
What is it, how in the coding gods underworld do you actually use it? Now, to help because i hear it can do some wide range of fancy pants things... Can I use it to assist in retrieving information from a file (probably xml) or database?


NOTE FOR BOTH: i have looked through the jQuery site for both of these things and can't seem to find them, looked through example codes such as lightboxes and other things like that, but I can't seem to find it!
thnx!

Nile
05-28-2009, 07:45 PM
To be able to pull out the ul with a selector, give it an id. Then in jquery:


$("#id")


Just like CSS.


JSON (JavaScript Object Notation) is a lightweight data-interchange format. It is easy for humans to read and write. It is easy for machines to parse and generate. It is based on a subset of the JavaScript Programming Language, Standard ECMA-262 3rd Edition - December 1999. JSON is a text format that is completely language independent but uses conventions that are familiar to programmers of the C-family of languages, including C, C++, C#, Java, JavaScript, Perl, Python, and many others. These properties make JSON an ideal data-interchange language.
http://json.org/