Posts

Showing posts with the label opera

The Layer ... Of The Layer ... Of The Layer ...

When I read tweets like this one I cannot avoid a quick comment but the reason I am posting, is simply to explain that every time we write a web page/application, we are dealing with at least 4 different layers. Moreover, this post is complementary for few slides I have introduced at front-trends, specially regarding the " avoid classic OOP emulation when not necessary " point. Layer #1: JavaScript Libraries We all know the DOM is a mess, and this is most likely the reason we chose a JS library rather than deal directly with possible problems we can have when we develop an x?HTML page. Even if many developers don't care, I keep saying that every millisecond gained in this first layer, the page itself, is important. Moreover, if we have a good understanding of the JavaScript programming language, we can easily realize that all these " Java Pretending Style Frameworks " emulating classic inheritance and OOP are not easier to maintain neither faster for what we...

Opera, Inevitably Unexpected

Update Opera fellas works at speed light, the problem described in this post has been patched already , great stuff and thanks! Just a quick one, about what I have discovered with Opera 10.62 when I have tested wru against this browser ... // host object var xhr = new XMLHttpRequest; // this is true alert("addEventListener" in xhr); // this is undefined // not even null // simply undefined!!! alert(xhr.addEventListener); The Problem 99% of libraries out there are assuming that key in object is one of the fastest and most reliable way to have features detection . Today, we know that this assumption is wrong . It's not about the reproducibility of the problem: var o = {}; o.key = o.key; "key" in o && o.key; It's about an ... Epic Fail (Already Fixed!) The engine " behind the scene " is broken . Whatever it happens there, we have a broken chain through pseudo inheritance that exposes publicly a method that does not exist , which brings u...

Opera Detection Revamped?

I am surfing in a nightmare of problems with IE and Opera right now ... all these problems come from sessionStorage implementation ... I am almost there, but right now just think about this question: How to know if onload and unload event are supported without firing them? Apparently, it has never been that simple! Object.prototype.toString .call(window.opera) === "[object Opera]" ; Enjoy P.S. Prototype Framework uses this trick since version 8, I had no idea about that! Good one!

Opera Unite ... or better, Server Widgets!

My plan to conquer the World was so close that I could not believe it: the power of my old Centrino 1.6 based Laptop, nowadays less powerful than latest Netbook, plus my fantastic USB pen to surf constantly switching between GPRS, HSDPA, and 56Kb with constant lags of service, and finally a magic Web Server directly inside a good browser! WOW, It's Done! What Blocked My Plans ... not the hardware, neither the connection, just the idea! First of all, I cannot understand (or maybe I can ...) that much why everybody should be excited by something like Opera Unite: the idea is not new the implementation is not that friendly there are hundreds of limitations Nothing New Somebody already complained about the un-innovative service or the browser integrated web-server, I would like to add the good old no-ip service to the list: install a Web Server, whatever it is, and as long as you are connected, no-ip will redirect a static url into your dynamic IP address. Easy? Moreover, you'll ...

fireEvent for FireFox, Safari, and others

Just a quick update about vice-versa , I have implemented fireEvent to fire, as the method name says itself, events after attachEvent. Do you prefer the dispatchEvent way with at least 3 different ways to initialize an event usually fired only to call the callback? It is this: a.addEventListener("click", function(evt){ location.href = evt.target.href; evt.preventDefault(); return false; }, false); // powerful uh? now think // when you used something different // from defaults ... var evt = document.createEvent("MouseEvents"); evt.initMouseEvent( "click", true, true, this, 0, 0, 0, 0, 0, false, false, false, false, 0, null ); a.dispatchEvent(evt); against what I think is often all we need: a.attachEvent("onclick", function(){ location.href = event.srcElement.href; return event.returnValue = false; }); a.fireEvent("onclick"); and that's it :)

Multiple Upload With Progress: Every Browser No Flash !!!

Image
Update: released official version in Google Code, cross browser, and easy to use. blog enry Ok guys, this is a quick and dirty entry in my blog. I need to write documentation, create the project in Google Code, explain better what I have done and how it works. I do not want to give you the zip right now because I have to change name (silly me do not check before) and to do last tests ... but basically, what I have created this week end, is a graceful enhanced multiple file upload manager compatible with Chrome, FireFox, Internet Explorer (5.5 or greater), Opera, Safari. The manager wrap an input type file and manages it allowing multiple files selection, where supported, or one after one insert with possibility to remove one or more file from the list. Everything is absolutely customizable, since the wrapper is entirely in CSS, the library has a language namespace for errors or messages, and events are created by developers. In those browsers were Ajax upload is not supported, the pro...

outerHTML for almost every browser ... if you need it ...

We all have to deal with memory leaks problem and apparently a good way to be sure that an HTMLElement has been removed from its "flow" is the outerHTML assignemnt (thanks Ariel for the suggestion) element.outerHTML = ""; element = null; If the element is not a document.body or another body parent node, Internet Explorer will "extract" that element from its context, if any, and if there are no other references for that element the null assignment will, theoretically, complete the opera, hopefully solving memory leaks problem for that node as well ... To remove ... but to replace too ... Every library has a " swap " or replace method to quickly change an element, but even if we all know that innerHTML is the fastest way to insert content, few libraries use outerHTML to replace nodes , that as far as I know, should be " that fast " in IE as innerHTML is: // traditional swap, the DOM way function swap(oldNode, newNode){ var parentNo...

Do You Like Browser Benchmarks? Here I am!

Hi guys, today we will not talk about my last JavaScript ArrayObject creation :D Today is the benchmark day, and in this case the test is as simple as explicative ... both Math object and scope are two things we use every day for whatever purpose in this baby Web 2.0 era! Let me start directly with results (ORDER BY speed ASC): Firefox 3.0b4 ---------------------------------- regular avg time in ms: 9.98 scoped avg time in ms: 3.18 encapsulated avg time in ms: 12.98 Safari 3.0.4 (523.15) ---------------------------------- regular avg time in ms: 13.42 scoped avg time in ms: 6.42 encapsulated avg time in ms: 11.82 Opera 9.24 ---------------------------------- regular avg time in ms: 13.82 scoped avg time in ms: 9.6 encapsulated avg time in ms: 17.64 Internet Explorer 8.0.6001.17184 ---------------------------------- regular avg time in ms: 16.42 scoped avg time in ms: 6.82 encapsulated avg time in ms: 16.82 Firefox 2.0.0.12 ---------------------------------- regular avg time in ms: 26....