Thursday, April 12, 2007

nonstandard property :: innerHTML (but is a de facto standard)

The innerHTML property is not part of the DOM. It isn't part of any standard. It is a proprietary addition created by Microsoft.

Normally, I wouldn't recommend using anything proprietary in JavaScript code (although the XMLHttpRequest object itself is a proprietary addition). However, the innerHTML property is exceptionally well supported, considering that it is nonstandard. It is, in effect, a de facto standard: it is supported in all the major browsers. The reason why innerHTML has been so widely adopted, without any endorsement from the W3C, is that it is very useful in certain situations.

DOM methods allow you to manipulate a document very precisely. You can create elements, attributes, and text, one node at a time. That is very powerful, but it is also quite time-consuming.

The innerHTML property uses brute force. If you read the innerHTML property of an element, you will receive a string of HTML. This is a read/write property, meaning that you can also assign a string of HTML to go inside an element.

Any HTML that was previously inside the element will be obliterated and replaced with the contents of the string.

Which you choose for your web app XML, JSON, or HTML?

If you are a Ajax developer you should know these three words XML, JSON & HTML (using innerHTML)

So which you will choose the best to get your data from server to manipulate on client browser? if you are not sure about this then read following article

What's Your Poison? XML, JSON, or HTML? by Jeremy Keith

which is a part of his book Bulletproof Ajax. The article is here:

As for my preference I use HTML as it is very easy way and safe also, read the article and decide what is best for you.

When Observing Users Is Not Enough

When observing users is not enough then read following article from Isabelle Peyrichoux

When Observing Users Is Not Enough: 10 Guidelines for Getting More Out of Users’ Verbal Comments

and learn what should be avoided and what should be adopted.

Opera 9.2 is out for lovers (all platforms)

Opera version 9.2 has been released. I’m sure everyone will find browsing faster and more enjoyable with Opera’s many new features

According to official opera blog:

9.2 is not only an important update with bug fixes and the new Speed Dial functionality, it’s also a milestone in spreading Opera to new users around the world: Opera 9.2 for Windows ships with 31 languages.

Download

Click here to download opera for Linux/UNIX, Window and Mac.

Wednesday, April 11, 2007

Copy MySQL database from one server to another remote server

Usually you run mysqldump to create database copy:
$ mysqldump -u user -p db-name > db-name.out

Copy db-name.out file using sftp/ssh to remote MySQL server:
$ scp db-name.out user@remote.box.com:/backup

Restore database at remote server (login over ssh):
$ mysql -u user -p db-name <>
How do I copy a MySQL database from one computer/server to another?

Short answer is you can copy database from one computer/server to another using ssh or MySQL client.

You can run all the above 3 commands in one pass using mysqldump and mysql commands (insecure method, use only if you are using VPN or trust your network):
$ mysqldump db-name | mysql -h remote.box.com db-name

Use ssh if you don’t have direct access to remote mysql server (secure method):
$ mysqldump db-name | ssh user@remote.box.com mysql db-name

You can just copy table called foo to remote database (and remote mysql server remote.box.com) called bar using same syntax:
$ mysqldump db-name foo | ssh user@remote.box.com mysql bar

This will not just save your time but you can impress your friend too ;).
Almost all commands can be run using pipes under UNIX/Linux oses.

MySQL connections can be made securely to a remote server via SSL. Just thought I would mention that as it is an additional option to consider. http://dev.mysql.com/doc/refman/5.0/en/secure-connections.html