Month: May 2009

Acid.JS Library 3.1 Has Been Released With 1 New Script

Get most of the website widgets and tools I’m developing in a single package that is regularly updated. Whenever a new script or script update is available, it will be included in the download file. To stay informed and up-to-date with Acid.JS, please, subscribe to my RSS feed.

AJAX Scripts Collection 2008-2009

Visit the new website of Acid.JS web 2.0 Component Library.

Acid.JS Library 3.0 Has Been Released With 6 New Additions

Get most of the website widgets and tools I’m developing in a single package that is regularly updated. Whenever a new script or script update is available, it will be included in the download file. To stay informed and up-to-date with Acid.JS, please, subscribe to my RSS feed.

Download the latest version of Acid.JS

Guestbook.XML – The New AJAX Guestbook

Guestbook.XML is easy to use, AJAX driven, crossbrowser and skinnable guestbook that will give your visitors pleasant Web 2.0 experience on your website.

The setup of the script is a matter of minutes, and the Admin panel offers 100% flexibility and killer customization options – string customization, profanity filter, html filter, skin changer, various moderation and validation options, etc. The script uses a flat file for data storage and mySQL is not required, just PHP and Apache Web Server.

Each time somebody posts a message in your Guestbook.XML, you will receive a notification email.

The public side of Guestbook.XML works with all major browsers – Internet Explorer 6/7/8, FireFox 2/3, Opera 9/10Beta, Safari 3/4 Beta and Chrome 1x. The admin panel works with Internet Explorer 6/7/8, FireFox 2/3, Opera 9/10Beta.

Creating Style Tag with JavaScript and Adding Rules to It

Sometimes, when working with dynamically created objects on the client, it is needed to style these elements in a specific way. Due to the nature of these objects (for example – unique IDs) , they cannot be styled in the classic way, though. The document.createElement method of JavaScript can be used to create <style>...</style> tag and append it in the <head>...</head> section of the page, however populating it with CSS rules / classes cannot be done with innerHTML under Internet Explorer, which implements a different method for this particular case – by applying the cssText method to the styleSheet object.

Below is an example of how to implement this approach.

function createStyleTag()
 {
  var head = document.getElementsByTagName('head')[0];
  var isChrome = navigator.userAgent.toLowerCase().indexOf('chrome') > -1;
  var isSafari = navigator.userAgent.toLowerCase().indexOf('safari') > -1;
  var cssstring = [
   '#MyDiv1 {' +
    'color: red;' +
   '}'
  ];
  if(!isChrome && !isSafari)
  {
   var styletag = $create('style');
   
   styletag.setAttribute('type', 'text/css');
   head.appendChild(styletag);
   
   if(!window.ActiveXObject)
   {
    styletag.innerHTML = cssstring; // if not Internet Explorer
   }
   else
   {
    styletag.styleSheet.cssText = cssstring; // if Internet Explorer
   }
  }
 }

The full example is available for download at this link.