This is the internal appframework object that gets extended and added on to it This is also the start of our query selector engine
Prototype for afm object. Also extens $.fn
Helper function to parse the user agent. Sets the following .os.webkit .os.android .os.ipad .os.iphone .os.webos .os.touchpad .os.blackberry .os.opera .os.fennec .os.ie .os.ieTouch .os.supportsTouch .os.playbook .feat.nativetouchScroll
Creates a custom event to be used internally.
any
a custom event that can then be dispatched
Execute an Ajax call with the given options options.type - Type of request options.beforeSend - function to execute before sending the request options.success - success callback options.error - error callback options.complete - complete callback - callled with a success or error options.timeout - timeout to wait for the request options.url - URL to make request against options.contentType - HTTP Request Content Type options.headers - Object of headers to set options.dataType - Data type of request options.data - data to pass into request. $.param is called on objects
var opts={
type:"GET",
success:function(data){},
url:"mypage.php",
data:{bar:'bar'},
}
$.ajax(opts);
XMLHttpRequest
This adds a command to execute in the JS stack, but is faster then setTimeout
$.asap(function,context,args)
Bind an event to an object instead of a DOM Node
$.bind(this,'event',function(){});
name
Function to clean up node content to prevent memory leaks
$.cleanUpContent(node,itself,kill)
itself
$.create - a faster alertnative to $("
$.create("div",{id:'main',innerHTML:'this is some text'});
$.create("<div id='main'>this is some text</div>");
Returns an appframework object
Iterates through elements and executes a callback. Returns if false
$.each([1,2],function(ind){console.log(ind);});
Extends an object with additional arguments
$.extend({foo:'bar'});
$.extend(element,{foo:'bar'});
any
[target]
Shorthand call to an Ajax GET request
$.get("mypage.php?foo=bar",function(data){});
to hit
XMLHttpRequest
Gets the css matrix, or creates a fake one
$.getCssMatrix(domElement)
matrix with postion
Shorthand call to an Ajax request that expects a JSON response
$.getJSON("mypage.php",{bar:'bar'},function(data){});
to hit
XMLHttpRequest
XMLHttpRequest
Checks to see if the parameter is a $afm object
var foo=$('#header');
$.is$(foo);
boolean
Checks to see if the parameter is an array
var arr=[];
$.isArray(arr);
boolean
Checks to see if the parameter is a function
var func=function(){};
$.isFunction(func);
boolean
Checks to see if the parameter is a object
var foo={bar:'bar'};
$.isObject(foo);
boolean
Execute a jsonP call, allowing cross domain scripting options.url - URL to call options.success - Success function to call options.error - Error function to call
$.jsonP({url:'mysite.php?callback=?&foo=bar',success:function(){},error:function(){}});
{}
Map takes in elements and executes a callback function on each and returns a collection
$.map([1,2],function(ind){return ind+1});
Array<any>
appframework object with elements in it
Converts an object into a key/value par with an optional prefix. Used for converting objects to a query string
var obj={
foo:'foo',
bar:'bar'
}
var kvp=$.param(obj,'data');
string
Key/value pair representation
this function executes javascript in HTML.
$.parseJS(content)
Used for backwards compatibility. Uses native JSON.parse function
var obj=$.parseJSON("{\"bar\":\"bar\"}");
any
Helper function to convert XML into the DOM node representation
var xmlDoc=$.parseXML("<xml><foo>bar</foo></xml>");
any
DOM nodes
Shorthand call to an Ajax POST request
$.post("mypage.php",{bar:'bar'},function(data){});
to hit
XMLHttpRequest
XMLHttpRequest
Creates a proxy function so you can change the 'this' context in the function Update: now also allows multiple argument call or for you to pass your own arguments ``` var newObj={foo:bar} $("#main").bind("click",$.proxy(function(evt){console.log(this)},newObj);
or
( $.proxy(function(foo, bar){console.log(this+foo+bar)}, newObj) )('foo', 'bar');
or
( $.proxy(function(foo, bar){console.log(this+foo+bar)}, newObj, ['foo', 'bar']) )(); ```
$.query - a faster alertnative to $("div");
$.query(".panel");
Returns an appframework object
Trigger an event to an object instead of a DOM Node
$.trigger(this,'event',arguments);
name
Unbind an event to an object instead of a DOM Node
$.unbind(this,'event',function(){});
name
Utility function to create a psuedo GUID
var id= $.uuid();
string