Arrow Functions https://strongloop.com/strongblog/an-introduction-to-javascript-es6-arrow-functions/
Category: JavaScript
JavaScript: Debugging
Sehr gute Übersicht der Möglichkeiten mit console-Methoden. https://medium.com/outsystems-experts/beyond-console-debugging-tricks-f7d0d7f5df4
JavaScript: Conditions
String http://tjvantoll.com/2013/03/14/better-ways-of-comparing-a-javascript-string-to-multiple-values/
JavaScript: Error Handling
Eigene Fehlerausgaben erzeugen // Throw TypeError message throw new TypeError(“Function.prototype.bind – what is trying to be bound is not callable”); // Throw anonymous error message throw new Error(‘An error occurred’); // Throw an own type of error message throw { name: ‘Variable Error’, message: ‘A mandatory value was not defined.’ }
Mobile Hints
JavaScript scroll Event wird bei Mobilen Plattformen erst nach Beendigung des Scrolls ausgelöst und nicht permanent wie bei Desktop-Browsern. Es kann stattdessen touchmove verwendet werden. touchmove Event löst auf iOS während der ganzen Fingerbewegung fortwärend aus. Auf Android wird der Event erst nach dem Aufheben des Fingerkontakts ausgelösst. Bei schwungvollen Bewegungen, bei denen der Finger […]
PHP, JS: Code Dokumentation
Diese PHP-Dokumentation, welche der Einfachheit halber auch für JavaScript verwendet werden kann, basiert auf PHPDoc1. /** * File documentation * * Description * * @category # Used to organize groups of packages together. # * @package # Can only be used to document procedural pages or classes. # * @author Patric Eberle * @copyright Copyright […]
JavaScript Objekte per PHP-JSON
Read More →Mobile Events
Orientation Events1 Die Reihenfolge der Events entspricht ihrer Auslösung. |==============================================================================| | Device | Events Fired | orientation | innerWidth | screen.width | |==============================================================================| | iPad 2 | resize | 0 | 1024 | 768 | | (to landscape) | orientationchange | 90 | 1024 | 768 | |—————-+——————-+————-+————+————–| | iPad 2 | resize | 90 […]
Basics
Datum Zur Erstellung und Ausgabe von Date()-Objekten in Javascript stehen diverse Möglichkeiten zur Verfügung auf elated.com wurde dazu ein umfangreicher Artikel1 veröffentlicht. http://www.elated.com/articles/working-with-dates/ [↩]
DropDown mit hover-delay
// delay function init $(document).ready(function() { mainNavigation.init(); }); // delay function var mainNavigation = { delay: 2000, closeTimeout: null, init: function() { $(‘#mainnav > li’).each(function() { $(this).hover(function(){ if(!$(this).hasClass(‘hover’)) { mainNavigation.closeSubnav(); } clearTimeout(mainNavigation.closeTimeout); $(this).addClass(‘hover’); }, function() { mainNavigation.closeDelay(); }); }); }, closeDelay: function() { mainNavigation.closeTimeout = setTimeout(function(){ console.log(‘close now’); mainNavigation.closeSubnav(); }, mainNavigation.delay); }, closeSubnav: function() { […]