- From: Anne van Kesteren <annevk@opera.com>
- Date: Sat, 08 Aug 2009 15:25:03 +0200
- To: "Jonas Sicking" <jonas@sicking.cc>
- Cc: "WebApps WG" <public-webapps@w3.org>
On Fri, 07 Aug 2009 02:19:21 +0200, Jonas Sicking <jonas@sicking.cc> wrote: > For example an web HTML editor. The editor lets you wysiwyg edit the > page as well as drop in images. Dropping in images creates a <img > src="uri-here" alt="..."> element. The edited page can then be saved > in localStorage, sent to the server using XHR, or posted to a parent > iframe using postMessage. > > It's possible, but very clunky, to always send images separately and > then refresh the inline uris any time the page is to be displayed. Fair enough. >>> It seems useful to use the same code for people that want to display >>> error messages to the user, this way you can either pass the value in >>> the DOM event or from an exception to the same function. >> >> If you use the same constant name you can still do that. > > I don't understand. The use case is: > > A page has a function to deal with displaying error messages to the > user. The function looks something like: > > function displayError(errorNumber) { > var errorString = getLocalizedErrorMessage(errorNumber); > document.getElementById("errorMessage").nodeValue = errorString; > errorDialog.classList.add("displayed"); > cancelTimeout(gErrorUITimeout); > gErrorUITimeout = setTimeout(hideError, 5000); > } If instead of errorNumber you passed the object you could do things like if (obj.SECURITY_ERR == obj.code) { ... } which is what I meant. Also, I'll note that you carefully snipped my inconsistency argument! -- Anne van Kesteren http://annevankesteren.nl/
Received on Saturday, 8 August 2009 13:25:46 UTC