Just watch: http://perceptivepixel.com/
Archive for July, 2007
alter css values dynamically with javascript
Posted by chris on July 26th, 2007
Comments(0)
You can use javascripts document.getElementById().style method to alter CSS values. Here’s an example:
Create your div tag:
Now create your javascript function:
function changeCss()
{
document.getElementById("myDiv").style.border = '2px dotted #CCC';
}
Now you can call this javascript function on any given event to alter your CSS tags border. Things like height, width, and a bunch others work as well. For instance create an html button, and onclick call the changeCss() function.
In ajax/dom/javascript ()
ajax and the xmlhttprequest object
Posted by chris on July 16th, 2007
Comments(0)
I’m teaching myself “ajax” here is how to create the basic xmlhttprequest object, interact with a server-side scripting language such as php, and display the returned xml to the page (in this case a series of html form text boxes).
In ajax/dom/javascript, php ()
easy mysql backup
Posted by chris on July 6th, 2007
Comments(0)
Here’s an example of quick script I wrote in PHP and added as a cronjob to backup some mysql databases:
// dump database tables to sql text files //
exec('mysqldump -uroot -pPasswordHere music > /tmp/music.sql');
exec('mysqldump -uroot -pPasswordHere taskfreak > /tmp/taskfreak.sql');
// pack into tarballs //
exec("tar -cf /tmp/music.sql.tar /tmp/music.sql");
exec("tar -cf /tmp/taskfreak.sql.tar /tmp/taskfreak.sql");
// gzip tarballs //
exec("gzip /tmp/music.sql.tar");
exec("gzip /tmp/taskfreak.sql.tar");