Posts Tagged ‘JavaScript’

Precepts from our JavaScript dictator

Posted in Miscellaneous on October 30th, 2009 by Thomas – Be the first to comment

Always declare your variables and functions:
Variables which are not declared will be global. This can result in many bugs hard to detect.

Always declare your variables in top of your block:
JavaScript does not have block scope, and it is better to always declare all variables at the top of each function.

read more »

How to load a map form Google’s online service “My maps” with Google map API JavaScript.

Posted in Miscellaneous on August 20th, 2009 by Thomas – Be the first to comment

Google has a fine user interface for adding pointers to their map in their service “My maps”. But how do you load this into your website?
read more »

Goodbye sIFR? Hello typekit?

Posted in XHTML / JavaScript / CSS on June 3rd, 2009 by Erland – Be the first to comment

(…)As a Typekit user, you’ll have access to our library of high-quality fonts. Just add a line of JavaScript to your markup, tell us what fonts you want to use, and then craft your pages the way you always have. Except now you’ll be able to use real fonts. This really is going to change web design(…)

http://blog.typekit.com/

The future: what it may or may not hold

Posted in Flash on April 16th, 2009 by Knut – Be the first to comment

We have recently had some discussions on the future of Flash. I did some googleing today and this is what I found:

“We think JavaScript is awesome. We also think browsers are awesome. Indeed, when we talk about them, we say they are the cat’s meow – which is an American expression meaning AWESOME.”

- Google

After looking at some of the examples here I think Adobe might have a slight problem in the near future and that us flashers are going to have to diversify sooner than later.  Meow.

Embedding Flash without messing up the HTML fall back

Posted in XHTML / JavaScript / CSS on April 1st, 2009 by Erland – Be the first to comment

Sometimes we need to insert a 100% Flash into a page. This little snippet shows you how you can achieve it without breaking the normal browser behavior (scrollbars etc) for users viewing the retro HTML fall back.

Prerequisites: jQuery and swfobject 2.

read more »

How to send metadata in header when using jQuery

Posted in XHTML / JavaScript / CSS on April 1st, 2009 by Thomas – Be the first to comment

Sometimes when working with Ajax one needs to send some metadata in addition to the normal response.

This is usually the case when the response is HTML or text and is quite common in other libraries, like prototype.

The problem in jQuery is that one can only access the response and status in the callback function “success”.

This is easily altered, but it must be done in the library itself.

read more »

Delay in jQuery

Posted in XHTML / JavaScript / CSS on April 1st, 2009 by Thomas – Be the first to comment

The jQuery library in comperison with the prototype library, do not contain a delay function.
If you work with animations and effects the jQuery FxQueues plugin will be useful.

jQuery FxQueues plugin expands the animation and effect functions with following options:

  • queue: (string) Name of the queue. If it doesn’t exist, it creates the new queue. If you pass false no queue is created.
  • scope: (string) Name of the scope.
  • position: (”front”|”end”) Queue position where animation (or scope, if passed) is queued.
  • preDelay: (int) Milliseconds to wait before starting the next in queue.
  • postDelay: (int) Milliseconds to wait after finishing the animation.

read more »

Geolocation in Browsers

Posted in XHTML / JavaScript / CSS on March 27th, 2009 by Anders – Be the first to comment

Opera has shipped a build of its browser, with built-in support for geolocation. Using javascript in accordance with the first working draft by the The Geolocation Working Group of the W3C, the website is able to get the geolocation of the visitor, opening up for a lot of exiting features.

Read more about this Opera build here

Firefox isn’t far behind, and the upcoming 3.1 version will also feature geolocation functionality. The user will be able to specify their location by choosing a geolocation service provider or manually entering their position.

Read more about this at Mozilla Labs

The Javascript Way

Posted in XHTML / JavaScript / CSS on March 26th, 2009 by Anders – Be the first to comment

The Javascript Way is a new site, set up by Tore Darell , Christian Johansen and August Lilleaas. Inspired by The Rails WayThe JavaScript Way aims to share best practises in JavaScript code, design and structure. 

The first submission talks about namespacing and encapsulation.