If you are using the Ruby on Rails acts_as_taggable plugin you may want to display the top tags in a tag cloud. To generate a tag cloud you will to write some code beyond just writing the controller action. You will need to augment the taggable plugin itself and create a function in the application [...]
Also posted in Ruby, TechKnow |
With JavaScript you can access and update an element’s style and even its class. Say that you have two CSS classes: .warning {color: yellow;} .error {color: green;} You can update or switch an element’s CSS class with the following JavaScript code: var element = document.getElementById(‘element’); element.className = ‘warning’; But you can access individual CSS attributes [...]
Also posted in JavaScript, TechKnow |
A lot of peeps are talking about Ajax this and Ajax that. Since JavaScript is the J in Ajax, what a lot of people have set out to do is create JavaScript effects libraries. There are several libraries available such as dojo toolkit, prototype framework, script.aculo.us, and others. I wanted to us some effects on [...]
Also posted in JavaScript, TechKnow |
Just because sometimes I forget, here are some code fragments to import JavaScript, CSS, and PHP files. JavaScript: <script type=’text/javascript’ src=’directory/file.js’> </script> CSS: <style type=’text/css’ media=’all’> @import ‘directory/file.css’; </style> Icon: <link rel=’Shortcut Icon’ href=’directory/file.ico’ type=’image/x-icon’> PHP: <?php @ require_once (‘directory/file.html’); ?> For the PHP import, by placing the @ symbol before require_once suppresses any error [...]