Tag: Javascript

Old code: CSS rules on the fly from JavaScript (2006)

Again, some old code I'm not using anymore since I switched to jQuery but that might be useful for someone: /* * Public Domain * Created by Toni Corvera <outlyer@outlyer.net> in September, 2006 * * Creates a new CSS ruleset, should work with multiple rules correctly * e.g.: * loadCssRules('body{font-family:sans-serif;}a:link{color:red;}'); */ // void function loadCssRules(String […]

Read More

Old code: DOM extensions (2004-2006)

Nowadays I'm using something more powerful like jQuery or base2.DOM, but if you don't, these might prove useful. /* * Copyright 2004-2006 Toni Corvera <outlyer@outlyer.net> * * License: http://www.gnu.org/copyleft/lgpl.html LGPL * * Extra DOM-like methods (Note that at the time of writing they can't be * bound to the Document prototype, so they are global […]

Read More

Old code: JavaScript x-browser arrays (2005, 2010)

Last update: 2010-12-09 This block of code is deprecated, I'm only keeping it for archival purposes, see below for a more up-to-date equivalent /* * Public Domain * * Created by Toni Corvera <outlyer@outlyer.net>, 2005 * * Defines Array.find, and Array.merge */ // int Array.find(Object) if (!Array.indexOf) {/*IE has no indexOf*/ Array.prototype.find = function(what) { […]

Read More