Path: csiph.com!usenet.pasdenom.info!news.albasani.net!news.teledata-fn.de!newsfeed.arcor.de!newsspool2.arcor-online.net!news.arcor.de.POSTED!not-for-mail Content-Type: text/plain; charset="ISO-8859-1" Message-ID: <2017556.lXCzD688iH@PointedEars.de> From: Thomas 'PointedEars' Lahn Reply-To: Thomas 'PointedEars' Lahn Organization: PointedEars Software (PES) Date: Tue, 29 May 2012 17:40:08 +0200 User-Agent: KNode/4.4.11 Content-Transfer-Encoding: 7Bit X-Face: %i>XG-yXR'\"2P/C_aO%~;2o~?g0pPKmbOw^=NT`tprDEf++D.m7"}HW6.#=U:?2GGctkL,f89@H46O$ASoW&?s}.k+&. Followup-To: comp.lang.javascript MIME-Version: 1.0 Lines: 62 NNTP-Posting-Date: 29 May 2012 17:40:09 CEST NNTP-Posting-Host: 906de3ff.newsspool4.arcor-online.net X-Trace: DXC=9]l5b=iLEDH=8m7nZkdN^@4IUKK@U@3`]Ai;BfBjhe::FKZX]M X-Complaints-To: usenet-abuse@arcor.de Xref: csiph.com comp.lang.javascript:14209 Tim Slattery wrote: > We have a legacy app that uses a somewhat odd method of submitting a > page, and it's giving us fits. > > There's no " button on the page. What is there > is an image of a "Continue" arrow surrounded in an tag. Here > it is: > > title="Continue through the Web site" scope="request" > > align="middle"/> > And invalid markup on top of that. I have seen such nonsense before in my job as well. > The "submit_page" script sets a couple of values and submits the form > Works just fine, nearly always. See below. > The problem is that in a very few cases, it looks like the href tag is > activated (for lack of a better term) The better (and correct) wording would be "the `A' element is activated". `href' is not a tag, it is an attribute (name). > without triggering the onclick. Unlikely, but possible. > The result is that the page is submitted to a nonexistent address. Incorrect. `""' is a same-document reference. As a result, there is a race condition if the `click' event is not canceled (which is short for "the default action of the `click' event is not prevented", see preventDefault()). > So my question is how could this happen? Client-side scripting is not supported or the submit_page() call throws an exception. You do not handle that exception, which is why the program aborts. If it aborts, usually the `onclick' attribute value is processed as if it was not there. > The errors seem to be reported by people using IE8. I've run my tests > with that browser and haven't turned up anything. The nature of a race condition is that it is not reproducible or hard to reproduce. Replace the legacy approach, and fix your function, so that there is no race condition. PointedEars -- Sometimes, what you learn is wrong. If those wrong ideas are close to the root of the knowledge tree you build on a particular subject, pruning the bad branches can sometimes cause the whole tree to collapse. -- Mike Duffy in cljs,