サクサク読めて、アプリ限定の機能も多数!
トップへ戻る
アメリカ大統領選
dean.edwards.name
A JavaScript Decompressor. version 1.0 Paste: Unpack Copy: disabled This only works in browsers which have a built-in pretty-printer.
I’ve finally updated my IE7 library. IE7 was in alpha for a long time. The last version was very stable but I always intended to issue a serious update. The release of the real IE7 browser threw me off course a little and then I got bogged down with base2. I’ve made some important changes to the script which I’ll now outline. The IE7 project is now hosted on googlecode (I got fed up with SourceFor
My current frog exaggerator of choice: var isMSIE = /*@cc_on!@*/false; Comments (67) Leave a comment Comment: #1 It seems to be the fastest and shortest way to know that, thank You! Comment: #2 ooops, maybe this one is even more horrible var isMSIE = /*@cc_on!@*/!1; reduced by 3 chars :rotfl: Comment: #3 […] Dean Edwards nous propose la méthode la plus courte (en terme de code )que j’ai eu l’occas
I wrote this about six months ago before starting work on base2. I decided not to post it at the time as I thought it sounded a little pompous. On reflection, they aren’t bad rules and I managed to stick to them. So, here the rules I wrote for myself back in October. 1. Be unobtrusive My HTML doesn’t want to know about your JavaScript. 2. Object.prototype is verboten! This is so important that it
Just what the world needs, another JavaScript library. Intro Because this library is standards-based it means that you don’t have to learn a new API. It uses standard DOM properties and methods throughout which also means that I don’t have to write any documentation. It is part of a suite of little libraries that I’m developing called base2. This is the first library under that umbrella and is cal
It seems easy doesn’t it? Just do this: // create the constructor var Array2 = function() { // initialise the array }; // inherit from Array Array2.prototype = new Array; // add some sugar Array2.prototype.each = function(iterator) { // iterate }; No problemo. Well, there is one problemo. Quite a big problemo in fact. You see, every developer’s favourite browser (Internet Explorer), refuses to mai
I’ve been experimenting with running code in an iframe and the results are very encouraging. Sandbox.eval() I’m currently developing a templating system in JavaScript and ran into a problem with scope. The problem is that my template scripts have access to all of the global (window) object’s properties and methods. I don’t want this. I want my template scripts to run in a separate, closed environm
To enable these behaviors on Mozilla platforms use the XBL wrapper moz-behaviors.xml. Does your browser support DHTML Behaviors? Here is a simple test. star-light.htc A DHTML Behavior that dynamically applies syntax highlighting to source listings (contained in a <pre/> tag for example). The syntax highlighter is fully configurable and modules exist for the following languages: JavaScript HTML CSS
A little known but cool feature of Internet Explorer is its support for XML data islands. Basically, you can embed some XML data in a page like this: <html> <head> <xml> <root>Some data</root> </xml> </head> Even cooler, you can reference an external data source: <xml src="data.xml"></xml> The classic “Ajax” way to load XML data involves a couple of ActiveX objects: var http = new ActiveXObject("M
A JavaScript Compressor. version 3.0 Help Paste: Base62 encode Shrink variables Load Clear Pack Copy: disabled Save Decode Also available as .NET, perl and PHP applications.
This is a follow-up to my original window.onload solution. The negative points of that solution are: For Internet Explorer you need an external JavaScript file We only had genuine solutions for Internet Explorer and Mozilla/Firefox (not Safari or Opera) Now, thanks to Matthias Miller, we have a solution for Internet Explorer which does not rely on external files: // for Internet Explorer (using co
Inspired by Roger Johansson’s Levels of HTML Knowledge: alert("Hello World"); var WORLD = "World"; function hello(who) { alert("Hello " + who); }; hello(WORLD); <button onclick="hello(WORLD)">Say Hello</button> <button id="hello">Say Hello</button> var button = document.all.hello; button.onclick = function() { hello(WORLD); }; var button = document.getElementById("hello"); button.addEventListener(
Alex Russell, head honcho of the Dojo Foundation, suggests a hideous hack to speed up DOM queries. Why does he want to do this? He wants behavioral extensions to be applied as quickly as possible and he has a point. For a good user experience the code to support a web interface should be applied as quickly as possible. A delay can lead to an unresponsive interface, confusing the user about what wo
This is my site for my personal use running on my machine in my kitchen! This site exists so that I can perform tests on web tools that I’m currently building. This work is open source and is available for download. In other words, I’m always messing about with this site but you can rip-off any code you want.
NB. I’ve amended the code samples below to reflect recent changes in this class. I’m an OO programmer at heart and JavaScript supports prototype based inheritance. Unfortunatley this leads to verbose class definitions: function Animal(name) {}; Animal.prototype.eat = function() {}; Animal.prototype.say = function(message) {}; I want a nice base class for JavaScript OO: I want to easily create clas
Welcome to the first of what I hope will be a regular series of JavaScript tips. Object detection is common in JavaScript. Browser irregularities mean that your code must sometimes contain branches for different browsers. Here is a simple way to speed up object detection for a leaner and meaner script. Instead of this: function addEvent(element, type, handler) { if (element.addEventListener) { ele
IE7 Compliance patch for Explorer! These files are available for download from Google Code. current version: 2.0 (beta) More information cssQuery2.zip cssQuery() is a cross-platform JavaScript function that enables querying of a DOM document using CSS selectors. All CSS1, most CSS2 and some CSS3 selectors are allowed. The function returns a JavaScript array of matching elements. current version: 2
Caching in IE This page is basically a duplication of a comment I made on mezzoblue. Introduction Whilst developing a work-around to background-attachment:fixed for IE7, I came across the horrible image flicker problem. Oh. And this is a browser problem not a server problem. Unfortunately the only way to fix it is by configuring your server. That pesky image flicker!! To clarify: only affects IE6.
PPK’s addEvent() Recoding Contest produced a number of very similar solutions. The eventual winner was chosen because of its simplicity. All of the solutions relied on object detection to some degree. My solution is very different. it performs no object detection it does not use the addeventListener/attachEvent methods it keeps the correct scope (the this keyword) it passes the event object correc
Well, when I say solved I mean solved for the two most important browsers – Internet Explorer and Mozilla/Firefox. Still that’s good enough isn’t it? First, let me define the problem. The window.onload event is used by programmers to kick-start their web applications. This could be something trivial like animating a menu or something complex like initialising a mail application. The problem is tha
cssQuery() version 2.0.2 getElementsByTagName? Pah! Introduction cssQuery() is a powerful cross-browser JavaScript function that enables querying of a DOM document using CSS selectors. All CSS1 and CSS2 selectors are allowed plus quite a few CSS3 selectors. Usage Syntax elements = cssQuery(selector [, from]); where selector (required) is a valid CSS selector and from (optional) is a document, elem
Overview IE7 loads and parses all style sheets into a form that Explorer can understand. You can then use most CSS2/CSS3 selectors without having to resort to CSS hacks. The lightweight script is a single-line inclusion in your HTML/XML document. No alteration of your original markup is necessary. Neither do you have to alter your CSS. IE7 provides Microsoft Internet Explorer with support for W3C
IE7.js is a JavaScript library to make MSIE behave like a standards-compliant browser. It fixes many CSS issues and makes transparent PNG work correctly under IE5 and IE6. This project is now hosted on google code: http://code.google.com/p/ie7-js/
このページを最初にブックマークしてみませんか?
『dean.edwards.name/』の新着エントリーを見る
j次のブックマーク
k前のブックマーク
lあとで読む
eコメント一覧を開く
oページを開く