Showing posts with label IE6. Show all posts
Showing posts with label IE6. Show all posts

Thursday, 13 November 2008

IE8 annoying me possible even more than IE6

Got up this morning about 8.15am and it was cloudy outside. It stayed cloudy and rainy all day. After a shower etc. and breakfast I checked my email, hotukdeals, andy rouse's blog and deviantart.

After that I checked my site on IE8 and first thing I noticed was the layout was broken, the adverts box had quite a large margin on its right hand side, and was overlapping with the content text. This was quite easy to fix though, just by setting a left margin for the advert box. However, I thought IE8 was meant to be standards compliant and would work the same as Firefox, Opera and Safari.

Next I noticed that a checkbox on the login form wasn't aligned with the label text correctly in all the IEs, so I fixed that with a negative top margin. So now I have 5 stylesheets - standard, IE6, IE7, IE8, IE-all. The IE-all sheet is not strictly neceasary as I could put the rule in each of the seperate IE stylesheets, but it makes it easier for me to have an IE-all sheet.

Then I discovered a major problem with my site in IE8 - the lightbox function would just make the screen turn black (rather than darkening the screen and displaying an image). After quite a bit of testing to try and find out why the image wasn't appearing I decided to try and fix the solid black background in case the image was being hidden behind the lightbox background. I did some searching on google for opacity in IE8 and found that you need to either put
filter: "progid:DXImageTransform.Microsoft.Alpha(Opacity=50)";
or
ms-filter: "progid:DXImageTransform.Microsoft.Alpha(Opacity=50)";
Both worked for me, so I have used the top one. I found that the image still wasn't apprearing. I did lots more testing and found that even if I applied sizing to the image, its offsetWidth was always 0.

I checked whether my code (including code generated via javascript) validated and it didn't. There were 2 problems - the lightbox image needed to be inside a container, rather than just appended to the body, and it needed an alt attribute. So I fixed this, the page validated, but still the same problem in IE8.

After much messing around, deleting and adding code, writing test pages etc. I finally found the problem was due to the lightbox background having 'position: fixed'. But without 'position: fixed' the background didn't appear at all. So I tried changing the javascript code so that the lightbox background was appended to the document hierarchy after the lightbox image container, and this fixed it - I now had both the image and background appearing in IE8. However, the image wasn't being centred in the screen correctly.

So next I did some messing about with the code trying to fix this problem, and it seems the problem is due to IE8 reporting a very small page height.

I tried the following, and all are very small, much less than the actual page height:
alert('window.innerHeight' + window.innerHeight + '\n'
+ 'document.body.clientHeight' + document.body.clientHeight + '\n'
+ 'document.documentElement.clientHeight' + document.documentElement.clientHeight + '\n'
+ 'window.scrollMaxY' + window.scrollMaxY + '\n'
+ 'document.body.scrollHeight' + document.body.scrollHeight + '\n'
+ 'document.documentElement.scrollHeight' + document.documentElement.scrollHeight + '\n'
+ 'document.body.offsetHeight' + document.body.offsetHeight + '\n'
+ 'document.documentElement.offsetHeight' + document.documentElement.offsetHeight);
The VHD of IE8 came with a developers tools program, which can show you the outline of various elements, so I highlighted the body and it is really small. I guess everything else on the page must be overflowing out of it.
I tried setting the body height to 100%, but it was still really small, it reached to nearly the bottom of the window when you were scrolled up to the top of the page. If I tried highlighting the HTML, this seemed to highlight the whole page. So I tried 'document.body.parentNode.offsetHeight', but this still gave a very small figure (possibly the window height). I did some googling but couldn't see anything about how to get the pageHeight in IE8. You can also see in the above image that IE8 messes up the login form if you scroll the page at all.

Trying to get these things working in IE8 took me from about 9.30am until about 5.30pm. I had a look on the MS webpages about IE8, but couldn't see anything about how near to release the beta2 (which I'm testing on) is meant to be, or when a release candidate or final version will be released.

Something weird I noticed when logging onto Blogger was that it said 'connecting to noetic.org'. No idea why it wanted to connect there, I couldn't see any links to them or anything on the landing page.

After dinner I checked my email and hotukdeals again and then watched an episode of Lost. Then I read various threads and the Pentax 50/1.4 review on dpreview.

Food
Breakfast: Coco pops; orange juice.
Lunch: 2x cheese on toasts; white grapes; satsuma; slice of iced lemon madeira layer cake; chocolate digestive biscuit bar; cup o' tea; Roses.
Dinner: Slice of pepperoni pizza; green beans; chips; salt. Pudding was a small cherry bakewell tart with custard. Coffee; Roses.

Monday, 10 November 2008

Trying to get Virtual hosts accessable via the LAN

Woke up this morning at 6am, but it was cloudy outside and I was sleepy so I went back to sleep. Got up at 7am, had a shower etc then had breakfast with Ben. After that I checked my email, deviantart, dpreview canon lens forum, Andy Rouse's blog and thewebsqueeze. Then I did a japanese lesson.

Did a bit of work on my website and got the Pogs info edit form working properly. Then I wanted to test it on IE6 so I tried to get my Apache virtual hosts working so the sites could be accessed over the local network.

My original httpd-vhosts.conf file looked like this:

NameVirtualHost 127.0.0.1

<virtualhost 127.0.0.1>
ServerName localhost:80
DocumentRoot "C:/xampp/htdocs"
</virtualhost>

<virtualhost 127.0.0.1>
ServerAdmin webmaster@site1.com
DocumentRoot "C:/xampp/htdocs/VHosts/public_html/Site1"
ServerName site1.com
ServerAlias www.site1.com
PHPIniDir "C:/xampp/htdocs/VHosts/public_html/"
</virtualhost>

<virtualhost 127.0.0.1>
ServerAdmin webmaster@site2.com
DocumentRoot "C:/xampp/htdocs/VHosts/public_html/Site2"
ServerName site2.com
</virtualhost>

<virtualhost 127.0.0.1>
ServerAdmin webmaster@milkcapmania.co.uk
DocumentRoot "C:/xampp/htdocs/VHosts/public_html/PogSiteV3"
ServerName PogSiteV3.com
</virtualhost>

And my windows hosts file (on my local machine, the server) looked like this:
127.0.0.1 localhost
127.0.0.1 site1.com
127.0.0.1 site2.com
127.0.0.1 PogSiteV3.com
::1 localhost
First I tried changing NameVirtualHost and the VirtualHost block for PogSiteV3.com to *. But that didn't work. I tried other variations e.g. *:80, but they didn't work either. When I say 'didn't work' I mean that on the machine acting as the server pogsiteV3.com went to the same directory as localhost rather than the pogsiteV3 directory. I also tried removing the last entry from the windows hosts file, but still no difference. I also found that simply saving the .conf file and restarting Apache didn't work, for some reason the changes I made would only work if I restarted the whole PC, which is annoying and takes a few minutes each time.

So I did some googling and found this thread where some shows how they setup their Apache so they could access Virtual Hosts from another machine on a local network.

So I copied what they did and it worked. After changing stuff around bit by bit (and having to restart my PC each time to check) I ended up with the following in my httpd-vhosts.conf file:
NamevirtualHost localhost
NamevirtualHost site1.com
NamevirtualHost site2.com
NamevirtualHost pogsitev3.com

<virtualhost localhost>
Servername localhost
DocumentRoot "C:\xampp\htdocs"
</virtualhost>

<virtualhost site1.com>
ServerName site1.com
ServerAlias www.site1.com
DocumentRoot "C:/xampp/htdocs/VHosts/public_html/Site1"
PHPIniDir "C:/xampp/htdocs/VHosts/public_html/"
</virtualhost>

<virtualhost site2.com>
ServerName site2.com
DocumentRoot "C:/xampp/htdocs/VHosts/public_html/Site2"
</virtualhost>

<virtualhost pogsitev3.com>
ServerAdmin webmaster@milkcapmania.co.uk
DocumentRoot "C:/xampp/htdocs/VHosts/public_html/PogSiteV3"
ServerName pogsitev3.com
ErrorLog C:/xampp/htdocs/VHosts/Logs/PogSiteV3-error.log
CustomLog C:/xampp/htdocs/VHosts/Logs/PogSiteV3-access.log common
</virtualhost>
And my hosts file (on both my local PC (the server) and the Virtual PC looked like this:
127.0.0.1 localhost
192.168.0.4 site1.com
192.168.0.4 site2.com
192.168.0.4 pogsitev3.com
With this setup I could access the sites both from my local machine (the server) and the Virtual PC. And of course so long as I setup the hosts file on any other PC in the Local Network, I would be able to access the sites from those machines as well.

But, Apache was giving me an error:
[Mon Nov 10 14:48:27 2008] [warn] NameVirtualHost site2.com:80 has no VirtualHosts
[Mon Nov 10 14:48:27 2008] [warn] NameVirtualHost pogsitev3.com:80 has no VirtualHosts
[Mon Nov 10 14:48:28 2008] [notice] Apache/2.2.4 (Win32) DAV/2 mod_ssl/2.2.4 OpenSSL/0.9.8e mod_autoindex_color PHP/5.2.3 configured -- resuming normal operations
[Mon Nov 10 14:48:28 2008] [notice] Server built: Mar 5 2007 11:23:00
[Mon Nov 10 14:48:28 2008] [notice] Parent: Created child process 2992
[Mon Nov 10 14:48:28 2008] [warn] NameVirtualHost site2.com:80 has no VirtualHosts
[Mon Nov 10 14:48:28 2008] [warn] NameVirtualHost pogsitev3.com:80 has no VirtualHosts
[Mon Nov 10 14:48:29 2008] [warn] NameVirtualHost site2.com:80 has no VirtualHosts
[Mon Nov 10 14:48:29 2008] [warn] NameVirtualHost pogsitev3.com:80 has no VirtualHosts
[Mon Nov 10 14:48:30 2008] [notice] Child 2992: Child process is running
[Mon Nov 10 14:48:30 2008] [notice] Child 2992: Acquired the start mutex.
[Mon Nov 10 14:48:30 2008] [notice] Child 2992: Starting 250 worker threads.
[Mon Nov 10 14:48:30 2008] [notice] Child 2992: Starting thread to listen on port 443.
[Mon Nov 10 14:48:31 2008] [notice] Child 2992: Starting thread to listen on port 80.


I did a bit more googling and reading and experimenting, and ended up with my conf file like this:
NameVirtualHost *:80

<VirtualHost *:80>
ServerName localhost:80
DocumentRoot "C:/xampp/htdocs"
</VirtualHost>

<VirtualHost *:80>
ServerAdmin webmaster@site1.com
DocumentRoot "C:/xampp/htdocs/VHosts/public_html/Site1"
ServerName site1.com
ServerAlias www.site1.com
PHPIniDir "C:/xampp/htdocs/VHosts/public_html/"
</VirtualHost>

<VirtualHost *:80>
ServerAdmin webmaster@site2.com
DocumentRoot "C:/xampp/htdocs/VHosts/public_html/Site2"
ServerName site2.com
</VirtualHost>

<VirtualHost *:80>
ServerAdmin webmaster@milkcapmania.co.uk
DocumentRoot "C:/xampp/htdocs/VHosts/public_html/PogSiteV3"
ServerName PogSiteV3.com
ErrorLog C:/xampp/htdocs/VHosts/Logs/PogSiteV3-error.log
CustomLog C:/xampp/htdocs/VHosts/Logs/PogSiteV3-access.log common
</VirtualHost>


I changed my hosts file on my local machine to:
127.0.0.1 localhost
127.0.0.1 site1.com
127.0.0.1 site2.com
127.0.0.1 PogSiteV3.com


And the hosts file on the Virtual PC to:
127.0.0.1 localhost
192.168.0.4 site1.com
192.168.0.4 site2.com
192.168.0.4 PogSiteV3.com


And it worked! Now I just need to see if I can do anything the make the Wii resolve those domain names to my machine's local IP address as well.

Blogger is quite annoying with posting the above code - it messes it up, even if you put the code in <pre> tags. So I found this handy website that encodes (and decodes) HTML characters.

Another error I noticed in the apache error log was that my site didn't have a favicon, so I googled about that and followed this guide to making favicons. The only thing missing from the tutorial is it doesn't tell you how to change the color depth of the image when saving. In photoshop you need to make sure your current Color mode is RGB, then go to Image > Mode > Indexed Color...
  1. Then in the pop up box you need to choose Local (Selective) for the palette.
  2. Colors - mess around with it choosing the fewest amount of colors you need to still get a good result. I only needed 32 colors (5 bits) for my icon.
  3. Forced set to Black & white.
  4. Transparency ticked as needed (I didn't have any transparency in my icon)
  5. Matte was greyed out and set to none
  6. Dither was set to Diffusion
  7. Amount set to 75%
  8. And Preserve exact colours not ticked.
Adobe has an article about changing the color bit depth in photoshop, but I needed to turn CSS off in my browser to be able to see it, otherwise the text was covered by a big grey box.

After getting that working properly I tested the site on IE6. The layout was messed up, but that was pretty easy to fix. Then I found that when you clicked on a menu item to expand it, an extra space would be added to the item title each time. It was easy to fix that as well, but strange that it should happen since normally multiple spaces in a row in HTML will render as a single space on the page.

Then I found a more serious problem - when you click on one of the pog images to load up the larger image in the lightbox, the login form at the top right hand corner of the page gets messed up. Both the input boxes in the form dissapear (well, they're still there but you can't see or access them). So I spent a long time trying to fix this. The problem seems to be with the IE filter for handling transparency in PNGs, which I am using in IE6. I found that if I change the id of the input, or insert a new input with a different id, then that input will display ok. But if I change the id of the input and then change it back to the original id, or insert a new input with the same id as the original input, then they won't display. I will have to look into this a bit more tomorrow.

About 9pm I finished watching Zulu with Maccy and Ben, then I went on hotukdeals and downloaded the latest VHD of IE6 for Microsoft Virtual PC 2007 since my current one kept saying it was past its expiration date.

The weather today was overcast all day and it rained most of the day.

Food
Breakfast: Coco pops; Banana; cup o' tea.
Lunch: Grated matured cheddar cheese with baby leaf salad sandwich; cherry tomato; apple; cup o' tea.
Dinner: Beef burger in bun with grated cheese, tomato ketchup and babyleaf salad; Chicken & vegetable soup in a mug; bun. Pudding was cheesecake with mandarin slices. Coffee.
Supper: Coffee; Mince pie.

Saturday, 5 April 2008

MS Virtual PC 2007

I spent most of today watching a Bob Dylan documentary and a pink panther film. The Dylan documentary was quite good, although it only covered a few years of his life, something like 1960-1966. Would have been more interesting if it had covered all his life up to now. It had some clips of performances by other good artists that me and yumpt had nae heard of, so we wrote them down as we watched the film:
  • Gene Vincent and the blue caps
  • Muddy Waters
  • Woody Guthrie
  • The new lost City Ramblers
  • Howlin' Wolf
I also downloaded Microsoft Virtual PC 2007 as using VMWare I have been unable to connect to my PC's localhost. After downloading it I found I already had it installed, so I installed win XP on it, and then found that MS actually provide virtual hard disk images pre-loaded with Win XP SP2 and IE6/7/8 that you can download for free from their website.

So I downloaded Windows XP SP2 with IE6 and Windows XP SP2 with IE8 images. Then I loaded them up, loads quicker than installing Win XP myself took. Also now means that I don't have to use the illegal version of Win XP I was using previously to test stuff on IE6.

To get internet and be able to connect to my localhost in the virtual PC I had to go on the settings for the virtual machine and change the networking adapter to 'Shared networking (NAT)'. Then to access localhost from the virtual machine I just had to type in the i.p. address of my actual PC.

After getting this working I deleted the old win XP virtual machine I had made, VMWare and a few other old programs I found in the add/remove programs section of control panel.

Food
Breakfast: Frosties; cup o' tea.
Morning snack: Crinkle crunch cream; milk chocolate digestive; cup o' tea.
Lunch: ½ Peppered ham sandwich; cheese on toast; satsuma; kitkat; cup o' tea.
Dinner: Chicken; parsnips; broccoli; potatoes; gravy. Pudding was apple pies with cream. Coffee. Chocolate truffle mix; easter egg.