From joel at bizba6.com Tue Feb 15 14:53:39 2011 From: joel at bizba6.com (Joel D Canfield) Date: Tue, 15 Feb 2011 13:53:39 -0700 Subject: [thelist] image swap works in Firefox and IE, not Chrome or Safari Message-ID: Testing on Win7 right now. This works in Firefox and IE, does nothing at all in Chrome and Safari. The code validates in HTML Tidy but I'm always suspicious of my javascript. What's broken here? Image Swap Javascript Example
Oasis
Joel
Tree
From ms2ger at gmail.com Tue Feb 15 15:26:49 2011 From: ms2ger at gmail.com (Ms2ger) Date: Tue, 15 Feb 2011 22:26:49 +0100 Subject: [thelist] image swap works in Firefox and IE, not Chrome or Safari In-Reply-To: References: Message-ID: <4D5AEF99.3010308@gmail.com> On 2011-02-15 09:53 PM, Joel D Canfield wrote: > Testing on Win7 right now. This works in Firefox and IE, does nothing at all > in Chrome and Safari. The code validates in HTML Tidy but I'm always > suspicious of my javascript. > > What's broken here? > > http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> > > > Image Swap Javascript Example > > > >
> Oasis
> Joel
> Tree >
>
> >
> > I note first that this code doesn't work in Firefox, but I think it would in Safari/Chrome. Your problem lies in onclick="imageSwap.src='papago_park_oasis.jpg';" Using an element's id as a variable in this way is not very well supported, and not really good practice either. A better solution would be: ... Oasis
Joel
Tree Note the |return false;|, which prevents the browser from loading the URL in the href attribute. HTH Ms2ger From willthemoor at gmail.com Wed Feb 16 16:35:51 2011 From: willthemoor at gmail.com (Will) Date: Wed, 16 Feb 2011 14:35:51 -0800 Subject: [thelist] Status codes for "not ready yet" In-Reply-To: References: Message-ID: On Mon, Jan 31, 2011 at 8:00 PM, Bill Moseley wrote: > A client makes an ajax call to fetch some data. There are a number of > different responses possible. I want to use HTTP status codes to represent > each response type. > Just came across http://httpstat.us/ (handy) and http://statuscodedrinkinggame.com/ (awesome) and thought of this thread. :)