Archive for April, 2008

Cross-browser Compatibility

Wednesday, April 23rd, 2008

I was working on a project that required cross-browser compatibility, this generally means at least FireFox and IE. The reason is due to the fact that IE is still the most commonly used browser (IE7, IE6, etc.), FireFox coming in second, and then the other browsers split up the rest.

I was trying to code the following structure:

<div>

<div/><div/>

</div>

<div>

<div/><div/>

</div>

Except the two inner most divs were floated left, followed by a break which cleared the float. The code rendered perfect in FireFox and IE7, but it didn’t render correctly in IE 6. So I wracked my head on it for a bit, looked up various reasons on why IE 6 might render the code differently, and eventually found a solution. The solution is to make the div’s position relative. This solution is completely counter-intuitive, and frankly, doesn’t make much sense. So the moral of the story is, sometimes the solution for things can be very dumb, but regardless, it’s the solution.

Dev and Live Environment

Saturday, April 12th, 2008

Today’s topic will be the importance of having two environments, one to develop your code in, and one to release into the public. Sometimes it is simply easier to edit, run, and test it in the live environment, but when your code deals with data, this becomes more problematic. Imagine some code that insert data into the database whenever you run it, if you run it in the dev environment, it’s really no big deal, but if you run it in the live environment, it might cause database pollution. Although your code should account for that case anyways, but it’s hard to say that during your “updates” you wouldn’t accident code it so that it starts inserting a bunch of meaningless data into your database. Having two environments will allow you to code and test in whichever way you want without having to worry about the consequences.

Migration from GoDaddy to BlueHost

Friday, April 11th, 2008

I have just finished moving my site from GoDaddy to BlueHost. This form of migration was the first one I’ve ever done, and it went quite smoothly.

I think a few tips that would help anyone migrate from one host to another would be to first figure out if you’re transferring the domain, web hosting, or both.

Domain hosting is simply the reservation of the domain name, such as google.com, yahoo.com, jacksonleung.com, etc., much like an address, or a telephone number.

Web hosting actually contains all the files and databases behind the domain name, much like the company an address points to, or the customer service representatives behind a telephone number.

If you’re simply changing the hosting, like I did in my case, not only will you have to migrate the database and the files, you’ll most likely have to change the namespace of your domains to the new namespace server of the web hosting provider.

Afterwards you have to make sure all the data from your databases were copied correctly from one server to another then you have to make sure all your script work with the new database environment. You might also want to move your emails from your old web hosting provider to the new one.

Although it might be unnecessary, I like to run through my scripts one last time just to make sure everything works, and after all that, you can cancel the domain / web hosting with the previous provider.