I have been working on a simple framework to put a website online for a friend. The premise are simple: No backend language available. No scripting. No database, here we go static site. Some idea of organization and structure, with separated pages. This means multiple page rendering, home/news/content1/about/contact. Common header […]
UI
Reverse a regex in javascript ? function reverse(s) { return s.split('').reverse().join(''); } function reverseSequence (s) { // chopper les expression conditionnelles // et construire un tableau pour les stocker var conditionals1 = s.match(/\[(.*?)\]/g); var conditionals2 = s.match(/(\[(.+)\])+\{(.*?)\}/g); var conditionals3 = s.match(/[A-Z\.]{1}\{(.*?)\}/g); var conditionals4 = s.match(/\^(.)/g); // on reverse la sequence […]
Attempt to reverse a regular expression
A little javascript class to handle geolocation in a web browser https://github.com/FabFab/GPS-in-your-browser How it works : GPS.get(); [...] var latitude = GPS.position.latitude; var longitude = GPS.position.longitude; or with a callback: GPS.get(updatePosition); function updatePosition() { var latitude = GPS.position.latitude; var longitude = GPS.position.longitude; [...] } More about Geolocation in web browsers: […]
GPS Geolocation in web browser class in Javascript
Sometimes you will need to replace an HTML <select> box by a custom one in order to apply special styles. Life might not allow you to use beautiful frameworks such as Jquery or Dojo, so you will have to manage without them, just with your own two hands… A first […]
Replace an HTML select box with onchange without jquery
One day I needed to get the function name from the function itself. Here is what I found. function functionName(fn) { var name=/\W*function\s+([\w\$]+)\(/.exec(fn); if(!name)return 'No name'; return name[1]; } via http://bytes.com/topic/javascript/answers/640929-obtain-function-name
get a function name from the function in Javascript
These past years JavaScript has been the language on the web. Through Ajax, we can do amazing dynamics things on a web page. From what I remember, when I started my first web page a while ago in 2002, Javascript was considered evil. Hard to program, poor documentation, and to […]
Why we love JavaScript
How to get an object real coordinates when there is a zoom or an scroll bar on the page ? var scrOfX = 0, scrOfY = 0; if (typeof(window.pageYOffset) == 'number' ) { //Netscape compliant scrOfY = window.pageYOffset; scrOfX = window.pageXOffset; } else if (document.body && (document.body.scrollLeft || document.body.scrollTop)) { […]
Coordinates when there is an offset in the page
I participated a while ago in Smashing Magazine CSS3 Contest. The aim was to play with CSS3. So I used my non-talent to design a menu enabling actions on a content, without Javascript. I used the general sibling selector ~, pseudo class :active, and some other well know stuff, such […]
CSS3 Smashing Magazine Contest
Yes, it exists. Its name is Firebug lite : http://www.makeuseof.com/tag/install-firebug-for-browsers-other-than-firefox/ ô Joie. It’s implemented in Javascript so it works with every browser, and it’s easily book-markable. If you need other Internet Explorer tools for web development : * myDebugBar and Companion.js are a buggy version of Firebug http://www.my-debugbar.com/wiki/CompanionJS/HomePage * IEtester […]
Firebug for IE and others
It seems that the last Internet Explorer 7 release (7.0.5730.13) has introduced a new bug while displaying a fullscreen web page : A white space appears at the bottom ! The problem comes from Windows taskbar, which somehow succeeds to interact with IE layout rendering system. The solution found to […]
IE7 bottom white bar
Today, some very useful links and tips while working on newsletter and webmails. You have to know that webmails such as Gmail are disabling several CSS properties inside their mails contents to ensure that the HTML code inside is not altering the webmails own design and layout. Imagine that in […]
CSS compatibility and mailboxes
Désolé, j’ai pas résisté… :D Comment ça marche ? Il vous faut pas loin le framework Ajax Javascript Prototype… <script src="javascripts/prototype.js" type="text/javascript"></script> Et il vous faut ce bout de code : if ( window.addEventListener ) { var kkeys = [], konami = "38,38,40,40,37,39,37,39,66,65"; window.addEventListener("keydown", function(e){ kkeys.push( e.keyCode ); if ( […]