this site made with datapod, hosted by a2hosting, part of tanguay.info
Home
Edward's Web Developer Site
Windows, Linux, AJAX, Ruby, Python, Java, CSS, XML, PHP5, Excel VBA, MySQL, C#, Perl, Flash, EVERYTHING...
Search Entire Site:
e.g. php array
My name is Edward Tanguay. I am a web developer in Berlin, Germany. I learn everything I can and record it on this site.
Other things you might be looking for:
My Ubuntu Tutorial
My Datapod Project
My Blog Feed:
- Code Examples
These are the latest code examples I've added. To find other code examples, use the search box in the upper-right.
Code Example: Javascript photo-viewer that works in four browsers
JAVASCRIPT CODE EXAMPLE - added 3 days ago
This was a little experiment to get a useful base of cross-browser code that does some interactive stuff in Javascript. It is simple but handles mouseover, button highlight, and just has a nice, basic feel. The only issue is in Opera the text is at top of the buttons, but didn't have any nerves left for that one. At first I tried using :hover and :focus which brought me to the conclusion that this really isn't standard between the browsers so used onmouseover and onmouseout to deal with it. Also worked out a number of quirks that various browsers had, e.g. I removed the ugly dotted focus line in Firefox on the buttons, they left it there in Firefox 3 as well I noticed, I replaced it with a gradient background for the focussed button. So this code looks decent in Firefox 2/3, Internet Explorer 7 (probably 6 too), Opera 9.5 (in fact only after I upgraded from 8 did it show the background on the buttons), and Safari. The bad boy of the group is Opera, but since opera gets embedded in quite a number of devices these days (e.g. Philips TVs), you don't want to leave it out completely. You can view this example online here. Of course next step when implementing this is to make it read from a database or XML file, I just wanted to get the browser-compatibility as accurate as possible first.
SHOW CODE

post comment or question
Code Example: How to display random quotes with Javascript.
JAVASCRIPT CODE EXAMPLE - added 6 days ago
This code uses the setInterval method to call a showQuote() function every 7 seconds, check out the online example.
SHOW CODE

post comment or question
Code Example: How to set simple cross-browser Javascript event handlers
JAVASCRIPT CODE EXAMPLE - added on July 1, 2008
This code runs in Explorer, Firefox, Opera and Safari, simple code that enables you to attach Javascript functions to button clicks, etc.
SHOW CODE

post comment or question
Code Example: How to use an .ini file with constants for e.g. translations
PHP CODE EXAMPLE - added on June 30, 2008
If you have various translations of your website, a quick way to implement this is to have an .ini file with all the translations in it and read it out. This code shows you how to also use constants within the ini file.
SHOW CODE

post comment or question
Code Example: How to position text in a div with left and right areas
CSS CODE EXAMPLE - added on June 30, 2008
This CSS script give you absolute pixel-exact control of where to place text in a left and right area of a wide div, e.g. a header or footer. I was not able to get it to align automatically, e.g. left/center/right, so you have to know your font size and your text and position things exactly, but at least you have control, checked in Firefox and Explorer.
SHOW CODE

post comment or question
Code Example: How to apply a simple filter to a label
FLEX CODE EXAMPLE - added on June 13, 2008
You can do a lot more with filters, e.g. dynamically change them in ActionScript but here is the syntax for a basic shadow filter on a text.
SHOW CODE

post comment or question
Code Example: Example of using CSS styles in Flex Builder
FLEX CODE EXAMPLE - added on June 13, 2008
Check out this example here. This shows you the basics of using styles in flex, I did all of this with the FlexBuilder in design mode, very easy to use, when you are in a CSS file just click on design. The alpha transparency is wonderfully easy and the background picture leaves behind all the problems you have with page backgrounds in HTML/CSS, namely, it constantly resizes it, etc.
SHOW CODE

post comment or question
Code Example: How to use ActionScript to access file system in AIR
FLEX CODE EXAMPLE - added on June 11, 2008
This is another example of access filesystem this time with ActionScript. Did an expanding window in this example, but there are some scrolling issues on this window I need to work out, couldn't find a scrollable=false in the application element. To try this example, download adobe air and then you can install this application.
SHOW CODE

post comment or question
Code Example: Basic file access example in AIR
FLEX CODE EXAMPLE - added on June 10, 2008
This shows you the basics of getting access to files and directories with AIR using FileSystemTree and FileSystemDataGrid. Would be interesting to see how these work in Linux and Mac. To try this example, download adobe air and then you can install this application.
SHOW CODE

post comment or question
Code Example: Basic syntax for Windows in AIR
FLEX CODE EXAMPLE - added on June 10, 2008
Here's how to get started with windows in an AIR application.
SHOW CODE

post comment or question
My Free Tutorials:
Tutorial: How to Install Ruby on Rails with Instant Rails and Create a Website Using JEdit and the Ruby Plugin
How to Install Ruby on Rails with Instant Rails and Create a Website Using JEdit and the Ruby Plugin
Tutorial: Install a PHP Development Environment with Eclipse PDT, Apache 2.2, PHP 5, MySQL 5, and phpMyAdmin Using XAMPP Lite
Install a PHP Development Environment with Eclipse PDT, Apache 2.2, PHP 5, MySQL 5, and phpMyAdmin Using XAMPP Lite
Tutorial: How to Install the Android SDK on Windows XP and Create an Application that Runs in the Cell Phone Emulator
How to Install the Android SDK on Windows XP and Create an Application that Runs in the Cell Phone Emulator
Tutorial: Install Ubuntu 7.04 in VMWare on Windows XP and connect it to your network
Install Ubuntu 7.04 in VMWare on Windows XP and connect it to your network
Tutorial: Setup a PHP Development Environment on Windows XP With Apache, PHP 5, MySQL 5, SQLite, Eclipse, Subversion, PHPMyAdmin, and Datapod
Setup a PHP Development Environment on Windows XP With Apache, PHP 5, MySQL 5, SQLite, Eclipse, Subversion, PHPMyAdmin, and Datapod
Tutorial: Install Java on Windows XP and Learn the Basics of Java 6 using the NetBeans IDE
Install Java on Windows XP and Learn the Basics of Java 6 using the NetBeans IDE
Tutorial: Install OpenSuse 10.2 in VMWare on Windows XP and connect it to your network
Install OpenSuse 10.2 in VMWare on Windows XP and connect it to your network
Tutorial: Install Fedora 6 in VMWare on Windows XP and connect it to your network
Install Fedora 6 in VMWare on Windows XP and connect it to your network
Tutorial: Install Perl 5 on Windows XP and Get a Perl Hello World Running
Install Perl 5 on Windows XP and Get a Perl Hello World Running
Tutorial: How to Create a Website with Datapod
How to Create a Website with Datapod
This site was made with Datapod.