Collected functions and objects for the CNET “Redball” family of sites.
| mootools | Moo.js, Utility.js, String.js, Array.js, Function.js, Element.js, Dom.js |
| cnet libraries | dbug.js |
Aaron Newton, <aaron [dot] newton [at] cnet [dot] com>
| jlogger.js | Collected functions and objects for the CNET “Redball” family of sites. |
| Jlogger | Enables clientside logging for any client side data or events. |
| Properties | |
| ping | Adds the call to DW with the passed in url; if url is not defined, it will create one with the options that were passed in when it was created. |
| pingTag | Use this instance of Jlogger and all its options, but ping DW with a different tag. |
| stopObserving | Stops pingging DW; can be turned back on with startObserving |
| startObserving | Starts pinging DW again; see also stopObserving. |
| Change Log | $Source: /cvs/main/flatfile/html/rb/js/global/cnet.global.framework/common/utilities/jlogger.js,v $ $Log: jlogger.js,v $ Revision 1.11 2007/03/10 00:37:10 newtona docs update |
Enables clientside logging for any client side data or events. You can capture any data the browser knows; resolution, scroll distance (see JlScroller), mouseover, etc.
Reports for Jlogger events can be found in CNET DW reports at
CNET Reporting > Shared Reports > Redball > Miscellaneous > JLogger Events
| options | optional, an object containing options. |
| tag | (required) the tag for DW |
| element | (optional) the id of the element or the DOM element itself or false; use false if you want to call //.ping yourself, use a dom element if you want to observe it using the event option below. defaults to false |
| event | (optional) the event that the element captures; load, click, etc. (do not include “on”) |
| ontid | (string or integer) the ontology id, defaults to the nodeId of the page |
| pId | (string or integer) the product id, defaults to the pageType of the page |
| edId | (string or integer) the edition id, defaults to the editionId of the page |
| siteId | (string or integer) the site Id, defaults to the siteId of the page |
| useraction | (optional; string or integer) the urs user action id, not used if not included |
| fireOnce | (boolean; optional) only fire this event once (true); fire every time (false; default) |
//ping DW when the window loads
new Jlogger({
ontid: '20',
siteId:'4',
pId:'2001',
tag:'windowLoad',
element: window,
event: 'load',
fireOnce: true
});
//ping dw when the user clicks on some element
new Jlogger({
ontid: '20',
siteId:'4',
pId:'2001',
tag:'somethingClicked',
element: 'myElementId',
event: 'click',
});
//ping DW NOW
new Jlogger({
ontid: '20',
siteId:'4',
pId:'2001',
tag:'someAction'
}).ping();
See JlScroller class for scroll capturing.
| Properties | |
| ping | Adds the call to DW with the passed in url; if url is not defined, it will create one with the options that were passed in when it was created. |
| pingTag | Use this instance of Jlogger and all its options, but ping DW with a different tag. |
| stopObserving | Stops pingging DW; can be turned back on with startObserving |
| startObserving | Starts pinging DW again; see also stopObserving. |
Adds the call to DW with the passed in url; if url is not defined, it will create one with the options that were passed in when it was created. Will not ping if fireOnce = true and this has already been fired.
| url | (string) the url to append to the dom (optional) |
| force | (boolean) execute the ping even if fireOnce=true and this has already been fired |
Use this instance of Jlogger and all its options, but ping DW with a different tag.
| tag | (string) the tag to use in the ping. |
| force | (boolean) execute the ping even if fireOnce=true and this has already been fired |
var jlWinLoad = new Jlogger({tag: 'myTag', element: document.body, event: 'load', pId: 12345});
//later...
jlWinLoad.pingTag('someOtherTag'); //pings DW with the new tag
//but doesn't alter the settings of the instanceStops pingging DW; can be turned back on with startObserving
Starts pinging DW again; see also stopObserving.
$Source: /cvs/main/flatfile/html/rb/js/global/cnet.global.framework/common/utilities/jlogger.js,v $ $Log: jlogger.js,v $ Revision 1.11 2007/03/10 00:37:10 newtona docs update
Revision 1.10 2007/03/10 00:31:10 newtona .pingDW is now just .ping element and event are no longer required (so jloggers can just get fired inline) executeNow is deprecated; just use new Jlogger().ping() added support for cval and ctype
Revision 1.9 2007/03/09 23:57:18 newtona docs update
Revision 1.8 2007/03/09 23:23:23 newtona * empty log message *
Revision 1.7 2007/03/09 20:15:03 newtona numerous bug fixes
Revision 1.6 2007/03/09 18:42:27 newtona options.name is no longer required or used
Revision 1.5 2007/02/21 00:30:18 newtona switched Class.create to Class.empty
Revision 1.4 2007/02/07 20:52:22 newtona implemented Options class implemented Events class
Revision 1.3 2007/01/26 05:56:03 newtona syntax update for mootools 1.0 docs update
Revision 1.2 2007/01/22 21:54:17 newtona updated for mootools version 1.0 updated namespaces to capitazlied values
Revision 1.1 2007/01/09 02:39:35 newtona renamed addons directory to “common” directory
Revision 1.4 2006/11/13 23:54:31 newtona added some error handling
Revision 1.3 2006/11/03 19:42:06 newtona moved jlscroller into it’s own file
Revision 1.2 2006/11/03 19:38:32 newtona Cleaning up a bit of code and documentation, mainly around the way the class stores options.
Revision 1.1 2006/11/02 21:28:08 newtona checking in for the first time.
function $A( array, start, length )
Use to iterate through iterables that are not regular arrays, such as builtin getElementsByTagName calls, arguments of a function, or an object.
function $each( iterable, fn, bind )
returns the element passed in with all the Element prototypes applied.
function $( el )