Path: csiph.com!usenet.pasdenom.info!news.albasani.net!uucp.gnuu.de!newsfeed.arcor.de!newsspool1.arcor-online.net!news.arcor.de.POSTED!not-for-mail Content-Type: text/plain; charset="UTF-8" Message-ID: <2691359.uFm2ZBFIHE@PointedEars.de> From: Thomas 'PointedEars' Lahn Reply-To: Thomas 'PointedEars' Lahn Organization: PointedEars Software (PES) Date: Thu, 26 Dec 2013 07:38:49 +0100 User-Agent: KNode/4.11.3 Content-Transfer-Encoding: 8Bit X-Face: %i>XG-yXR'\"2P/C_aO%~;2o~?g0pPKmbOw^=NT`tprDEf++D.m7"}HW6.#=U:?2GGctkL,f89@H46O$ASoW&?s}.k+&. <52b9f810$0$9502$9b4e6d93@newsspool1.arcor-online.net> MIME-Version: 1.0 Lines: 82 NNTP-Posting-Date: 26 Dec 2013 07:38:52 CET NNTP-Posting-Host: f208f4b4.newsspool1.arcor-online.net X-Trace: DXC=\70>F`hH>7>L2C_`koXfC5ic==]BZ:af>4Fo<]lROoR1nkgeX?EC@@0\BGGOn[Md>8DZm8W4\YJN Denis McMahon wrote: >> I suggest that you put all your code in a single script section in the >> head of the document, … thereby, *in general*, *slowing down* display and causing all kinds of other problems (IOW, bad advice) … >> that you don't use the "language" attribute for the >> script section, but instead use the type attribute: >> type="text/javascript" >> >> Ignore any elf-like apparition that tries to tell you this is wrong, and >> instead search the web to find out why this is right. Unsurprisingly, the Web tells why the former is, in general, wrong, and the latter is correct. > It is absolutely fine to omit the type attribute, AFAIK. The only > reason for using it, is to satisfy HTML 4.x[1] and XHTML 1.x; HTML5 is > most likely (it is still a CR) going to drop this requirement[2]. It depends on how compatible you want to be and what programming languages you are using in the document; see also the testcase referred in (there will be a new URI for it). >> Later on you may wish to separate your js code and data, and possibly >> have some server side system that automatically generates new data files >> when you update some set of master shipping cost tables. >> >> You have unescaped ampersands in your countries option list, and your >> innerhtml code includes html closing tags which it is usually a good idea >> to split up, eg instead of: >> >> blah.innerHTML += ""; >> >> use something like: >> >> blah.innerHTML += "<"+"/"+"B>"; >> >> to avoid any sequence of '<' + '/' + letter occurring inside the script >> tags, as these may confuse the rendering engine. > > A simpler and more efficient solution to comply with HTML parsers (which > might consider blah.innerHTML += "<\/B>" > > (Of course, one should preferably build up the value of the innerHTML > property in advance.) A solution relying on “innerHTML” etc. alone is not accessible as it will not work if a script engine is not used. > [1] > [2] Read more carefully before you cite: -- PointedEars Twitter: @PointedEars2 Please do not Cc: me. / Bitte keine Kopien per E-Mail.