Choose Your Theme
Warren Shea

Archive for the ‘Browsers’ Category

Site Updates: & IE8

Thursday, April 26th, 2012 at 2:02 pm uses HTML5, which isn’t supported by IE8. Which is unfortunate because IE8 is used pretty frequently.

I didn’t wanna do another stylesheet/javascript and update both…so I used one of my favorite things: my proxy.php file

This is my default.php for Unfortunately, I did have to do a big IF statement but that’s okay because this code never changes. So what it does is check it it’s IE8 (ie. doesn’t support HTML5), and then changes some of the tags: <header> to <div id=”header”>. I’ll likely change the IF statement to something better later…but that’s not the point of this post.

$srvr_http_user_agent = $_SERVER[‘HTTP_USER_AGENT’];
if ((stristr($srvr_http_user_agent,”MSIE 6.0″) == true) ||
  (stristr($srvr_http_user_agent,”MSIE 7.0″) == true) ||
  (stristr($srvr_http_user_agent,”MSIE 8.0″) == true)) {?>
<!doctype html>
    <link rel=”stylesheet” href=”common/proxy.php?url=stylesheet.css&type=css”>
    <div id=”header”>
      <div id=”nav”>
        <ul id=”nav-text”></ul>
        <ul id=”nav-background”></ul>
    <script src=”common/proxy.php?url=scripts.js&type=js”></script>
</html><?php } else { ?><!doctype html>
<html lang=”en-us”>
    <link rel=”stylesheet” href=”common/stylesheet.css”>
        <ul id=”nav-text”></ul>
        <ul id=”nav-background”></ul>
    <script src=”common/scripts.js”></script>
</html><?php } ?>

Doing this gets rid of some HTML5 tags but the CSS and JavaScript/jQuery still reference the HTML5 tags. So I like to use my proxy.php, which loads a URL, and gives me the option to manipulate it.
FYI – For XML, I use it for my twitter XML (I used to have it done through JavaScript but I found that it hindered load time).

<?php header(“Expires:Mon, 31 Dec 2010 05:00:00 GMT”); ?>
$page_contents = file_get_contents($_GET[“url”]);
if ($_GET[“type”] == “css”) {
  header(“Content-type: text/css”);
  $page_contents = str_replace(“header”,”#header”,$page_contents);
  $page_contents = str_replace(“##header”,”#header”,$page_contents);
  $page_contents = str_replace(“footer”,”#footer”,$page_contents);
  $page_contents = str_replace(“##footer”,”#footer”,$page_contents);
  $page_contents = str_replace(“content-#footer”,”content-footer”,$page_contents);
  $page_contents = str_replace(“nav”,”#nav”,$page_contents);
  $page_contents = str_replace(“##nav-text”,”#nav-text”,$page_contents);
  $page_contents = str_replace(“##nav-background”,”#nav-background”,$page_contents);  
} else if ($_GET[“type”] == “js”) {
  header(“Content-type: application/javascript”);
  $page_contents = str_replace(‘$(“header”)’,’$(“#header”)’,$page_contents);
  $page_contents = str_replace(‘$(“nav”)’,’$(“#nav”)’,$page_contents);
  $page_contents = str_replace(‘$(“footer”)’,’$(“#footer”)’,$page_contents);
} else if ($_GET[“type”] = “xml”) {
  header(“Content-type: text/xml”);
echo $page_contents;

Yes, it’s very hacky and likely not efficient but it does the job.
It changes: (HTML5 good) to (HTML5 bad)
and (HTML5 good) to (HTML5 bad)
but I only have to edit one file and it’ll make the non-HTML5 version automatically. Sweet.

Anyways, I thought this was worth sharing. Someone might find this technique useful.

<in Orcish> Werk Werk!

Friday, March 18th, 2011 at 1:48 am

So the senior developer that works with me has gone on vacation this week so I’m helping out with 3 of his tasks.

And while the timelines are tight (one week) and as of today (Thursday), I’ve only fully completed 1 of them, I gotta say that I’m having more fun working than I have in months. I can’t disclose the nature of the projects for obvious reasons…but 2 of the 3 of them involve learning something new or building something interesting. And the third project, the one that doesn’t involve learning something new…likely won’t get done by the end of this week :D

Anyways, one of them, let’s call it Project X, involves
1. Developing in a better language than I’m used to.
2. Developing on a different browser and platform.
It’s just…different. Challenging but within my reach.
The best part is that I can apply the things I’ve learned in Project X to So I may do that in the near future. Again, I can’t tell you what I’m doing yet….be patient, I’ll reveal it in a matter of time.

So on Sunday-Monday, I worked from 2am-6am. That was brutal and pretty much messed up my day. Good thing for Overtime Pay :) Well, technically I slept from 6am-noon so I missed a few hours in the morning. But ah well, I made it up that night (had to do some testing from 5pm-7pm).
Tuesday – Worked from 9:30am-10:30pm on Project X (13 hours)
Wednesday – Worked from 9:30am-Midnight on Project X (15.5 hours)
Thursday – Worked from 9:30am-4:30pm on Project X, went to Richmond Hill to have dinner with my family (parents, niece, nephew, bro, etc.), came back, worked AND FINISHED Project X! WAHOO!
Friday (tomorrow) – Work on Project Y from 9:30am-5pm, go to a basketball game (Raptors VS Wizards), maybe go to a birthday dinner after, and then come home and hopefully work on Project Y
Saturday – Possible Birthday party (another one), possible Toronto Comicon. If I don’t do that, I’ll be working on Project Y.
Sunday – Project Y.

So Project Y involves (from a technical standpoint)
Taking a Querystring from the URL
Loading a server generated XML via a JSP (see next point) but using the Querystring from the URL (thus, using AJAX to generate the XML as it needs to be after page load)
The JSP loads the XML from a cross-domain XML (this must be done so that my page can access the XML and prevent the cross-domain issue)
Anyways, eventually I end up with the XML, unique to the querystring.
I parse it, output the content to the page. I need to create a paging system manually (I’m using only HTML and JavaScript here, no server side languages).
And done!

Well, as I wrote that out, it doesn’t seem hard at all. Time consuming, but fun. Not doing standard HTML/CSS/JavaScript….using AJAX, XML, Querystrings (in JavaScript)…it’s interesting.

Anyways, that’s Project Y. Sounds easy, the (not hardest but) time consuming part will be outputting the XML into the page…I did the same thing here: [Redacted] a couple years ago…that was fun. God, there’s SO MUCH JAVASCRIPT on that page. browserDetection functions because I didn’t know jQuery at the time. JavaScript AJAX calls because I didn’t know jQuery at the time. Multiple XMLs, JSON….I had months to do that thing. Project Y has 3 days. So I’m gonna work my arse off partly because of the responsibility I feel that I need to deliver to the senior developer, but mostly because I simply can’t wait to do this. Not sure how much I’ll learn but it certainly sounds fun. 2 days to do it is pretty tight, especially considering it’s the weekend and I might do other stuff on Saturday….but I’m always up for a developing challenge.

I swear, if I didn’t have to work the next day, I would have pulled all nighters doing what I was doing this week. I loved it so much. Coding all night, just me, my music, my text editor and my focused, enthusiastic, eager mind. It’s not everyday I’m so excited to do work after all…I may as well milk it.

Anyways, off to bed. Based on the amount of sleep I’m gonna get tonight…I predict being very tired for the Raptor game tomorrow. Stupid me. Seriously.

My Personal (Developer) Resolve

Wednesday, January 12th, 2011 at 1:31 pm

To be awesome at (almost) all aspects in the limited stage of the web.

*The following is a list on all the web-related items that I already know, would like to learn, and have no interest in learning (despite being related to the web). Some points may not seem to make sense, that is because my knowledge in the area is so terrible that I don’t know what I’m writing >_<

This Resolve includes:

  • The ability to develop proficiently in various development languages, frameworks, and techniques including:
    • ASP.NET 4.0 C#
    • ASP 3.0 VB (Classic)
    • HTML5
    • PHP 5
    • XHTML 1.0/HTML 4.01
    • JavaScript
    • MS SQL (and mySQL)
    • Ruby (on Rails) (maybe…)

    • CSS2
    • CSS3
    • SASS
    • OOP
    • AJAX
    • JSON
    • XML
    • XSL/XSLT
    • DOM
    • DHTML

    • jQuery
    • Prototype (and
    • MooTools

    • Google Chart API
    • Facebook API
    • Twitter API
    • Google Search Appliance API

  • The ability to develop for major browsers including Chrome, Firefox, Internet Explorer, Safari and (maybe) Opera
  • Familiarity with Web Accessibility standards including:
    • WCAG 2.0 standards
    • CNIB (The Canadian National Institute for the Blind) Priority Level 2
  • Understanding of fundamental SEO principles and Analytic tools including:
    • Google Analytics
    • Google Search Appliance
  • Knowledge of various Content Management System and Web Publishing tools including:
    • Drupal 7 and Drupal
    • WordPress and Blogger
    • Vignette 7 and Vignette 6
  • Proficiency in various graphic programs including:
    • Photoshop
    • Fireworks

This Resolve does not include:

  • Mobile development (although this may change in the future)
  • Email development
  • Development of non-web languages including:
    • C
    • C++
    • Java
    • Visual Basic
    • Perl
    • Python
  • Development of non-web languages that are fundamentally from the list above including:
    • JSP (Java) (although this may change in the future)
    • Mason (Perl)
    • Django/Zope (Python)
  • Development of supporting web languages:
    • ActionScript
  • Proficiency in web-related tools including:
    • Flash, Premiere, Illustrator
    • Silverlight (although this may change in the future)

Chrome > Firefox? yes wai.

Wednesday, September 22nd, 2010 at 8:45 am

After using Firefox for 4+ years, I’ve finally decided after a month that Google Chrome is indeed better. By better, what do I mean?

  1. It’s faster. Quite obvious, FireFox can be REALLY SLOW.
  2. Occasionally FireFox decides to take 50% of your CPU resources for no reason. Maybe that’s just me but it happens at home and at work so I determine through flawless logic that it happens to all of you.
  3. FireFox, once I’ve begun to notice, crashes frequently. Chrome has yet to crash on me during its use.

FireFox > Chrome for 3 reasons:

  1. FireFox Web Developer addons are awesome. Does Chrome has equivalents? I don’t know but should probably find out.
  2. Chrome doesn’t seem to refresh files upon “SHIFT REFRESH”. Not a big deal unless you frequently web design and develop. o wait.
    Edit: It’s CTRL-F5
  3. Chrome has no good FTP extension. My FireFox remains open all the time solely for that.

All 3 reasons are probably/possibly specific only to me.

I’ve tried the FireFox 4 beta. Same stuff. Chrome > FireFox4

I plead with you: Give Chrome a try. Use it for a month. You’ll love it.

If you remain stubborn in your ways, resistant to change, fail to evolve, you’ll fall behind in technology. Next thing you know, you’ll be like your parents.
“I don’t know how to use Windows”
“You can touch a screen now?”
“I just heard of this website, YouTube. You can watch stuff on it.”
And then you go -_-;
Except it’ll be your kids doing -_-; to you! How embarrassing. UNLESS YOU DOWNLOAD, INSTALL, AND USE CHROME!

/best. sales. pitch. evah., warrenshea, and Google Chrome

Sunday, August 15th, 2010 at 5:19 pm

I’ve decided to start trying to use Google Chrome a bit more, give it a chance as my default browser over FireFox.

There are quite a few interesting things (PROs)
1. typing words into the address bar performs a Google Search is one of them…that’s friggin awesome.
2. the UI is smaller, about 1/2 in size.
3. it’s faster
4. it’s seems to Crash less. Firefox has been crashing, for no reason, lately. It’s annoying!

1. No FireFTP, FireFox Developer Toolbar…need to find equivalents or something

Also, my site currently doesn’t render so well in Chrome. I have to do some debugging….which I’m doing right now!

I just learned about CSS Hacks for IE8 and Chrome. I knew them for IE and IE6…

#footer-container {
_margin-top:-214px; /* for IE6 */
*+margin-top:-214px; /* for IE7 */
margin-top:-212px\0/; /* for IE8 */
body:nth-of-type(1) #footer-container { /* for Chrome */
margin-top: 0px;

Damn….on my list of things to learn:

It’s difficult staying current, especially staying current on so many languages/techniques. Like I told my co-worker, being a jack of all trades does not work as a professional. You have to pick 1 or 2 things and devote yourself to that…now…what do I devote myself to? I don’t know….

I like being a jack of all trades :'(