Archive for the ‘Web Development’ Category

Strange FireFox CSS Issue

Monday, November 2nd, 2009

An oddity I came across today in FireFox, is when I apply height to the input selector, it also defines and shows hidden elements.

firefox_form.png

Those white stripes are because of the following rule:

#paypal_form input {
margin-left: 200px;
display: block;
height: 15px;
margin-bottom: 10px;
}

There may be some other Cascading rules, but I couldn’t find it, and I’ve never seen it before.

“IE Users Can Suck It!

Tuesday, June 30th, 2009

“Firefox 3.5 is out, and, among a slew of major improvements, it now supports the HTML 5 <audio> and <video> tags. I don’t post many video clips to Daring Fireball, but henceforth, when I do, it’ll be with the <video> tag. IE users can suck it.”

I’m in the same boat in this attitude.

FireFox 3.5

TinyMCEditor Fail

Thursday, May 14th, 2009

If you a lot of work in a web based rich text editor, you know some of the headaches it causes. One of the most popular is TinyMCE rich text editor which offers a host of optins for styling, adding images, applying classes, font styles and many of the common HTML elements.

One of the things it doesn’t do well is write clean code. Take this example, where a paragraph already has a bit too much styling applied inline, and rules out any styles in your CSS file.

&lt;p style="font: normal normal normal 14px/normal Cambria; margin: 0px"&gt;Ten miles north of Westport lies a neighborhood in east Bridgeport where crime is an everyday occurrence and struggling to make ends meet is a way of life. In this neighborhood, on a side street next to a burnt out crack den sits a cheery yellow house offering hope for women and children in the area who want to learn English. &lt;/p&gt;&lt;p style="font: normal normal normal 14px/normal 'Times New Roman'; min-height: 15px; margin: 0px"&gt;&lt;/p&gt;

SafariScreenSnapz016.pngThere are 2 icons that look pretty helpful, a broom and an eraser. Oh these are clean up tools.Thinking the buttons labeled “Clean Messy Code” or “Remove Formatting” would create clean, un-styled code resulted in a complete unreadable mess.

Clicking Clean Messy Code resulted with:

&lt;p style=&quot;font: normal normal normal 14px/normal Cambria; margin: 0px&quot;&gt;Ten miles north of Westport lies a neighborhood in east Bridgeport where crime is an everyday occurrence and struggling to make ends meet is a way of life. In this neighborhood, on a side street next to a burnt out crack den sits a cheeryyellow house offering hope for women and children in the area who want to learn English.&lt;/p&gt;&lt;p style=&quot;font: normal normal normal 14px/normal &#x27;Times New Roman&#x27;; min-height: 15px; margin: 0px&quot;&gt;&lt;/p&gt;

Sweet, no change. Does it even do anything?

Click Remove Formatting resulted with:

<span style="font-size: x-small; font-family: Verdana">&nbsp;<br />
Ten&nbsp;miles&nbsp;north&nbsp;of&nbsp;Westport&nbsp;lies&nbsp;
a&nbsp;neighborhood&nbsp;in&nbsp;east&nbsp;Bridgeport&nbsp;
where&nbsp;crime&nbsp;is&nbsp;an&nbsp;everyday&nbsp;occurrence&nbsp;
and&nbsp;struggling&nbsp;to&nbsp;make&nbsp;ends&nbsp;meet&nbsp;
is&nbsp;a&nbsp;way&nbsp;of&nbsp;life.&nbsp;In&nbsp;this&nbsp;neighborhood,&nbsp;
on&nbsp;a&nbsp;side&nbsp;street&nbsp;next&nbsp;to&nbsp;a&nbsp;burnt&nbsp;
out&nbsp;crack&nbsp;den&nbsp;sits&nbsp;a&nbsp;cheery&nbsp;yellow&nbsp;
house&nbsp;offering&nbsp;hope&nbsp;for&nbsp;women&nbsp;and&nbsp;
children&nbsp;in&nbsp;the&nbsp;area&nbsp;who&nbsp;want&nbsp;to&nbsp;
learn&nbsp;English.&nbsp;<br />

Oh yeah, that’s really what I wanted. WTF? It’s like Jerry Lewis helping out and things just get worse and worse.

Building a Force Download Script with PHP and JavaScript

Tuesday, March 10th, 2009

I’ve had the recent challenge of writing a script to forcing a file to be automatically downloaded from a webpage. If you’ve ever gone to sites such as Download.com, or Tucows.com and downloaded a file then you’ve seen this technique in action.

The idea is rather than you clicking a direct link on a file to be downloaded, a script is used as a sort of redirect to the file itself. This gives the developer a chance to determine who you are, if you have access to the file and anything else he wants to dynamically generate.

The Problem
I had to present a page, which a user would read over then click to load a form. They would then fill out the form and submit this to the server which would result in a file being downloaded and the form disappearing (or being removed from the page).

The Solution
I used a mix of PHP and JavaScript with the help of Prototype/Scriptaculous libraries. Here is the page being examined:
Divvies Stores

(more…)