WebDev - Iain White's thoughts and tips on Web Development

first birthday WebDev is 1 Year Old Today!The WebDev blog is 1 year old today, I started this blog back in 2011 with the hope that it would give Developers a resource of helpful tips and information.

Thanks for reading.

 

General | Leave a comment

Internet Explorer 7 Logo IE does not trap events on transparent elements!

I recently developed a web application that needed a transparent layer to cover some parts of the site, to prevent mouse over’s and click events triggering on the underlying elements.

This worked as expected in all browsers except Internet Explorer.

After a bit of research and testing it turns out that IE does not trap events if an element is transparent!?

The work around was to give the element a background colour and then set its opacity to 0.9, which makes it almost transparent and able to trap events.

CSS | Leave a comment
Tagged: , ,

We are uncovering better ways of developing
software by doing it and helping others do it.
Through this work we have come to value:

Individuals and interactions over processes and tools
Working software over comprehensive documentation
Customer collaboration over contract negotiation
Responding to change over following a plan

That is, while there is value in the items on
the right, we value the items on the left more.

Kent Beck

Mike Beedle

Arie van Bennekum

Alistair Cockburn

Ward Cunningham

Martin Fowler

James Grenning

Jim Highsmith

Andrew Hunt

Ron Jeffries

Jon Kern

Brian Marick

Robert C. Martin

Steve Mellor

Ken Schwaber

Jeff Sutherland

Dave Thomas


© 2001, the above authors
this declaration may be freely copied in any form,
but only in its entirety through this notice.

General | Leave a comment

Providing the world with FREE wireless broadband.

freenet logo Freenet

Freenet was created as a service to the end user and a low cost method for businesses to advertise both socially and one to one marketing strategies.

The concept of Freenet includes advertising at the top of each page served inside a web browser as a way of funding broadband at no cost to the end clients but without being malicious or “hard to live with”.

Visit www.gofreenet.com for more details.

General | Leave a comment

PHP 5.4.0 Release Announcement

PHP 5.4.0 is available.
This release is a major leap forward in the 5.x series,
and includes a large number of new features and bug fixes.

The key features of PHP 5.4.0 include:

  • New language syntax including Traits an a shortened array syntax
  • Improved performance and reduced memory consumption
  • Support for multibyte languages now available in all builds of PHP at the flip of a run-time switch
  • Built-in webserver in CLI mode to simplify development workflows and testing
  • Cleaner code base thanks to the removal of multiple deprecated language features
  • Many more improvements and fixes

Changes that affect compatibility:

PHP 5.4 will be the last series to support Windows XP and Windows 2003. We will not provide binary packages for these Windows versions after PHP 5.4.

General, PHP | Leave a comment

NORAD Santa Tracker

NORAD Tracks Santa is an annual Christmas-themed entertainment program, which has existed since 1955, produced under the auspices of the North American Aerospace Defense Command (NORAD). Every year on Christmas Eve, “NORAD Tracks Santa” purports to follow Santa Claus as he leaves the North Pole and delivers presents to children around the world.

http://www.noradsanta.org/santa1 Merry Christmas

General | Leave a comment

THE NIGHT BEFORE CHRISTMAS

by Clement Clarke Mooreor Henry Livingston

‘Twas the night before Christmas, when all through the house
Not a creature was stirring, not even a mouse;
The stockings were hung by the chimney with care,
In hopes that St. Nicholas soon would be there;
The children were nestled all snug in their beds,
While visions of sugar-plums danced in their heads;
And mamma in her ‘kerchief, and I in my cap,
Had just settled down for a long winter’s nap,
When out on the lawn there arose such a clatter,
I sprang from the bed to see what was the matter.
Away to the window I flew like a flash,
Tore open the shutters and threw up the sash.
The moon on the breast of the new-fallen snow
Gave the lustre of mid-day to objects below,
When, what to my wondering eyes should appear,
But a miniature sleigh, and eight tiny reindeer,
With a little old driver, so lively and quick,
I knew in a moment it must be St. Nick.
More rapid than eagles his coursers they came,
And he whistled, and shouted, and called them by name;
“Now, Dasher! now, Dancer! now, Prancer and Vixen!
On, Comet! on Cupid! on, Donder and Blitzen!
To the top of the porch! to the top of the wall!
Now dash away! dash away! dash away all!”
As dry leaves that before the wild hurricane fly,
When they meet with an obstacle, mount to the sky,
So up to the house-top the coursers they flew,
With the sleigh full of toys, and St. Nicholas too.
And then, in a twinkling, I heard on the roof
The prancing and pawing of each little hoof.
As I drew in my head, and was turning around,
Down the chimney St. Nicholas came with a bound.
He was dressed all in fur, from his head to his foot,
And his clothes were all tarnished with ashes and soot;
A bundle of toys he had flung on his back,
And he looked like a peddler just opening his pack.
His eyes — how they twinkled! his dimples how merry!
His cheeks were like roses, his nose like a cherry!
His droll little mouth was drawn up like a bow,
And the beard of his chin was as white as the snow;
The stump of a pipe he held tight in his teeth,
And the smoke it encircled his head like a wreath;
He had a broad face and a little round belly,
That shook, when he laughed like a bowlful of jelly.
He was chubby and plump, a right jolly old elf,
And I laughed when I saw him, in spite of myself;
A wink of his eye and a twist of his head,
Soon gave me to know I had nothing to dread;
He spoke not a word, but went straight to his work,
And filled all the stockings; then turned with a jerk,
And laying his finger aside of his nose,
And giving a nod, up the chimney he rose;
He sprang to his sleigh, to his team gave a whistle,
And away they all flew like the down of a thistle.
But I heard him exclaim, ere he drove out of sight,


“Happy Christmas to all, and to all a good-night.”

General | Leave a comment

I recently worked alongside an intern developing Drupal CMS based websites and was given a fresh view of how junior developers can on occasions leap to conclusions.

In the book The Pragmatic Programmer, one of the software development tips is:

‘select’ Isn’t Broken
It is rare to find a bug in the OS or the compiler, or even a third-party product or library. The bug is most likely in the application.

The individual I worked with was a talented and quick to learn developer, but I was surprised how often during his first Drupal project he looked for issues outside his code.

Memorable comments where “I can make it work, but I need to hack Drupal core”, “I need to change the encoding of the database” and “There is a patch for Drupal 7 that will fix this”.

The intern was a good developer, he had skill and passion, and he just needed some more experience.  The Drupal CMS is used by thousands of web sites, the company we worked for had hundreds of Drupal sites running the same or similar configurations.  There was a good chance that Drupal was not broken.

General | Leave a comment

When you output a Jump Menu from a View in Drupal 6, it displays & instead of the ampersand.

Therefore ‘Terms & Conditions’ appears as ‘Terms & Conditions’ in the menu.

The following bit of PHP code fixes this problem:

/* Fix jump menu options encoding */
function hook_form_alter(&$form, &$form_state, $form_id) {
  switch ($form_id) {
    case 'ctools_jump_menu':
      foreach ($form['jump']['#options'] as $key => $value) {
        $form['jump']['#options'][$key] = html_entity_decode($value, ENT_QUOTES);
      }
  }
}
PHP, Snippet Library - PHP | Leave a comment
Tagged: ,

The PHP code snippet below shows how to add a GROUP BY
clause to a Drupal 6 View.

function hook_views_pre_execute(&$view) {
  switch($view->name) {
    case 'Services2':
      $search = array('ORDER BY');
      $replace = array('GROUP BY node_data_field_parent_service.field_parent_service_nid ORDER BY');
      $view->build_info['query'] = str_replace($search, 
                                               $replace, 
                                               $view->build_info['query']);
    break;
  }
}
PHP, Snippet Library - PHP | Leave a comment
Tagged: ,
Page 1 of 612345...Last »