core
| name | up |
| description | selects from document or given context |
|
var el1 = _("#target"); |
|
| Comments | |
| name | id |
| description | returns the element with given id |
|
var el = _.id("target"); |
|
| Comments | |
| name | tag |
| description | returns html element collection with given tag |
|
var els = _.tag("p"); |
|
| Comments | |
| name | name |
| description | returns html element collection with given name |
|
var el = _.name("username"); |
|
| Comments | |
| name | clss |
| description | returns html element collection with given class |
|
var els = _.clss("content"); |
|
| Comments | |
| name | attr |
| description | returns html element collection with given attribute and value |
|
//returns the elements href equals #goto |
|
| Comments | |
| name | select |
| description | returns html element collection by applying selector to element |
|
//selects the elements with name equals q from HTMLDIV elements |
|
| Comments | |
| name | create |
| description | returns html element constructing from source |
|
var el = _.create("<div><ul></ul></div>"); |
|
| Comments | |
| name | parent |
| description | returns parent of a dom element |
|
var el = _.parent(_.id("role")); |
|
| Comments | |
| name | children |
| description | returns children of a dom element |
|
var el = _.children(_.id("role")); |
|
| Comments | |
| name | next |
| description | returns next dom element |
|
var el = _.next(_.id("role")); |
|
| Comments | |
| name | prev |
| description | returns previous dom element |
|
var el = _.prev(_.id("role")); |
|
| Comments | |
| name | first |
| description | returns first child |
|
var el = _.first(_.id("role")); |
|
| Comments | |
| name | last |
| description | returns last child |
|
var el = _.last(_.id("role")); |
|
| Comments | |
| name | replace |
| description | replaces old node with new node of element |
|
var el = _.replace(_.id("role"),_.id("old"),_.id("new")); |
|
| Comments | |
| name | remove |
| description | removes value from element |
|
var el = _.remove(_.id("role"),_.id("child")); |
|
| Comments | |
| name | append |
| description | appends value to element |
|
var el = _.append(_.id("role"),_.id("child")); |
|
| Comments | |
| name | insertBefore |
| description | inserts value before the element |
|
var el = _.insertBefore(_.id("role"),"<div><ul></ul></div>"); |
|
| Comments | |
| name | insertAfter |
| description | inserts value after the element |
|
var el = _.insertAfter(_.id("role"),"<div><ul></ul></div>"); |
|
| Comments | |
| name | clone |
| description | returns clone of html element |
|
var el = _.insertAfter(_.id("role")); |
|
| Comments | |
| name | focus |
| description | focus to element |
|
var el = _.focus(_.id("role")); |
|
| Comments | |
| name | foreach |
| description | for each list elements applies func |
|
_.foreach(_.children(_.parent(_.id("a"))),function(){ |
|
| Comments | |
| name | setAttr |
| description | sets element's name to value |
|
_.setAttr(_.id("role","name","role")); |
|
| Comments | |
| name | getAttr |
| description | returns element's attribute value |
|
_.getAttr(_.id("role","name")); |
|
| Comments | |
| name | setStyle |
| description | sets element's style name to value |
|
_.setStyle(_.id("a"),"color : green"); |
|
| Comments | |
| name | getStyle |
| description | returns stle of an element |
|
var el = _.getStyle(_.id("a")); |
|
| Comments | |
| name | addStyle |
| description | if name is specified replaces with value else adds to style |
|
_.addStyle(_.id("a"),"text-align","right"); |
|
| Comments | |
| name | removeStyle |
| description | removes the style |
|
_.removeStyle(_.id("a"),"text-align"); |
|
| Comments | |
| name | html |
| description |
if called with one param returns html string of an element else replaces html of the element |
|
_.html(_.id("a"),"<div><ul></ul></div>"); |
|
| Comments | |
| name | extend |
| description | extends destination with source |
|
var destination = { foo: "bar", baz: { bang: "zoom" } }; |
|
| Comments | |
| name | get |
| description |
if called with two params(url,callback) else (url,type,callback) makes a http get request |
|
_.get("http:yusufaytas.com/upjs/ajax.php",function(data){ |
|
| Comments | |
| name | post |
| description |
if called with two params(url,callback) else if(url,type,callback) or (url,data,callback) else (url,data,type,callback) makes a http post request |
|
_.post("http:yusufaytas.com/upjs/ajax.php","name=yusuf",function(data){ |
|
| Comments | |
| name | ajax |
| description | makes a ajax request with options |
|
var options = { |
|
| Comments | |
| name | attach |
| description | attaches function to events for element |
|
_.attach(_.id("role"),"click mouseover",function(){ |
|
| Comments | |
| name | loaded |
| description | calls fn when document is loaded |
|
_.loaded(function(){ |
|
| Comments | |
| name | redirect |
| description | redirects the page to given url |
|
_.redirect("http:www.yusufaytas.com"); |
|
| Comments | |
| name | toggle |
| description | toggles display none with block and vice versa |
|
_.toggle(_("#id")); |
|
| Comments | |
| name | toggleClass |
| description | toggles display none with clss and vice versa |
|
_.toggle(_("#id"),"myClass"); |
|
| Comments | |
| name | setClass |
| description | sets element class |
|
_.setClass(_("#id"),"myClass"); |
|
| Comments | |
| name | getClass |
| description | returns class name of an element |
|
var clss = _.getClass(_("#id")); |
|
| Comments | |
| name | removeClass |
| description | removes class of an element |
|
_.removeClass(_("#id")); |
|
| Comments | |