Archive for the ‘Web Development’ Category

Workaround bzr-upload FTP “Connection reset by peer” issues

Thursday, March 12th, 2009

Have problems using the bzr-upload plugin to upload to an FTP server? I recently had repeated troubles getting a large web site to complete the initial full upload to an FTP server on a not so great connection. The upload would start fine, make it partial way through, and quit with the error:

bzr: ERROR: socket.error: (54, 'Connection reset by peer')

(more…)

Redirect After Post, But Not On Failure

Saturday, January 10th, 2009

Post/Redirect/Get (PRG) is a great practice, but don’t use it when the post is a failure. Here are some reasons:

  • If post failed because of non-validation issue, e.g. if “try again later” was the result, then the client only has to refresh the page to submit the post again.
  • It’s more efficient (greener) and easier to develop: if redirecting even on failure, then you must store the post data in the session and pull it back out to refill the form (or require the user to fill out the entire form again).

Implementation examples follow:

(more…)

Track Download Links Using jQuery and Google Analytics

Wednesday, October 22nd, 2008

Once you’ve got Google Analytics working, you can use jQuery to easily track other links on your site, such as download links.

(more…)

Adhering to Section 508

Monday, October 24th, 2005

As a government entity, it is required by federal law to adhere to Section 508 of the Rehabilitation Act, and meet minimum requirements of the W3C’s Web Content Accessibility Guidelines.

To meet minimum requirements, the entity must satisfy the “Priority 1″ Checkpoint (=Conformance Level “A”). See:

JavaScript Does Not Validate

Tuesday, October 4th, 2005

Remember to put CDATA tags around the actual JavaScript code if it uses < or &. See Script and Style elements at the W3C. For example, use:

<script type="text/javascript">
<![CDATA[
... unescaped script content ...
]]>
</script>

Actually, the above does not work correctly in Mozilla browers such as Firefox. See Properly Using CSS and JavaScript in XHTML Documents. They recommend putting everything in external files. If that’s not possible, use a modification of the above code:

<script type="text/javascript">
//<![CDATA[
... unescaped script content ...
//]]>
</script>

Useful Validation Links: