( ! ) Warning: session_start(): open(/tmp/sess_7f8eb3a709f6ff0ade08b5919d505105, O_RDWR) failed: Disk quota exceeded (122) in /www/noahlabs/jwee/init.php on line 7
Call Stack
#TimeMemoryFunctionLocation
10.0010383912{main}( ).../index.php:0
20.0014397184include( '/www/noahlabs/jwee/init.php' ).../index.php:3
30.0014397184session_start ( ).../init.php:7
Variables in local scope (#2)
$Browser =
/www/noahlabs/jwee/init.php:7:*uninitialized*
$Session =
/www/noahlabs/jwee/init.php:7:*uninitialized*

( ! ) Warning: session_start(): Failed to read session data: files (path: /tmp) in /www/noahlabs/jwee/init.php on line 7
Call Stack
#TimeMemoryFunctionLocation
10.0010383912{main}( ).../index.php:0
20.0014397184include( '/www/noahlabs/jwee/init.php' ).../index.php:3
30.0014397184session_start ( ).../init.php:7
Variables in local scope (#2)
$Browser =
/www/noahlabs/jwee/init.php:7:*uninitialized*
$Session =
/www/noahlabs/jwee/init.php:7:*uninitialized*
Getting Started - Noah Ellman - Javascript Toolkit
mrspoonzy at gmail Cube by Noah Ellman A powerful javascript toolkit, in research © by Noah Ellman

Getting Started

To help you get started, here is an overview of the fundamentals. To work with any javascript framework, including jwee, it is required that you at the very least have a beginners knowledge of the javascript language.

For introductions to the Javascript langauge, try searching google for now.

If you have used another framework in the past, or if you are experienced with the javascript language, you will most likely find jwee very easy to understand and use.

  • If you are familiar with jQuery
  • Then know that jQuery() is just like jwee() in its use for selecting elements by ID. $() is an easier to type alias for jwee().
  • However, unlike jQuery, in jwee element methods are part of the elements themselves, and not part of jwee object.
  • If you are familiar with Prototype
  • Jwee also installs magic methods to DOM elements.
  • Jwee also extends the native objects, like String and Array with additional methods.
  • In Jwee you can use $() for getting an element by ID.

Key things to know

  • The Jwee object is window.jwee, or simply jwee.
  • jwee itself also contains some uncatagorized functions
  • jwee.dom contains functions for accessing DOM elements and properties
  • jwee.ua contains user agent information
  • jwee.cookie contains cookie related functions
  • jwee is a function itself (see below)
  • For convience sake, many of the commonly used functions have global aliases.
  • $ is an alias for jwee
  • $() is the same as jwee() and jwee.dom.id()
  • Dom is the same as jwee.dom
  • Elem is the same as jwee.elem
  • UA is the same as jwee.ua
  • There are others, but this is a start

Accessing elements

Lets say we have a <DIV> with the id of "foo".

<div id="foo">
Hello World.
</div>

To access this <DIV> in code, we use the $, which is just like getElementById.

var myDiv = $('foo');

Note - It is important to note that $ returns the actual DOM element (not a psuedo-element framework object).

The $ function ensures that the element is also enhanced with additional magic methods. For a complete reference to these methods, see here. For example:

$("foo").update("Goodbye World");
// The text in the DIV will change to the text above

Accessing elements with CSS selectors

You can get an array of elements matching a given CSS query using Dom.select(). Only use $() for getting by ID. The framework, jQuery, combines all forms of querying into the $() function, but jwee does not. Why?

Dom.select("input");   // All input form items
Dom.select("#foo a");   // All links within the element with id="foo"

var elements = Dom.select("div.hidden")   // All div elements that are the CSS class "hidden"
elements.each( function() {
    this.removeClass("hidden"); 
} );

// The above line removes the class "hidden" from all DIV's which have it.

Discussion on /getting-started




TheDoctor 11/05/14 :  

Title on this page is messed up: www.jwee.org/getting-started


Zach 11/05/14 :  

@Xymon: Absolutely. My email is zlanich at gmail dot com if you don't wanna post something that extensive in the discussion. Thanks man.


Zach 11/05/14 :  

@Jwee Ninja: Thnx Ninja! I'm def excited about this library. I'm looking forward to seeing how it develops over time. It took me hours to find it :)


Zach 11/05/14 :  

@TheDoctor: You referring to me? lol