Wednesday, January 6, 2010

strange php/doctype bug

i was just spending the last few hours making a simple php template to use for websites when i came across a real strange bug. my template basically echos out the code for the document head, body and footer and inserts custom html in the middle somewhere.

now whenever i echoed out the head section with any doctype in it and any linebreaks, it put a space as the first character in the document, even though the source code was perfect.

i tried all kinds of str_replace on various hidden characters, \n, \r\n, \t etc. but to no avail. in the end i resorted to fixing it with css. i could have just had the entire head section on one line, but it bugged me and i wanted my template to spit out nice neat code.

anyways, will have the template up soon for all to download and use...

Labels: , , ,

Wednesday, June 17, 2009

stange swfobject ie6 error stops flash vars loading

well just spent 2 hours fixing this bug so hopefully this helps someone out there. I'm building a flash site as usual using the latest swfobject ( 2.2 ). the site was great in every browser except ie6 where for some reason my preloader was getting called twice and on the second load, the flashvars were ignored making the whole site break.

solution : normally i have my swfobject code called in the head section. i found that if i wrapped the embed code in a function, and then called that function on the body onload event it fixed the bug. once the site is launched. i'll post the code. send me an email if you need it sooner.

EDIT: here's the website that I used this trick on :
http://www.malvernstar.com.au/legend

Labels: , , , ,