Path: csiph.com!usenet.pasdenom.info!weretis.net!feeder4.news.weretis.net!news.musoftware.de!wum.musoftware.de!fu-berlin.de!uni-berlin.de!not-for-mail From: Jake Jarvis Newsgroups: comp.lang.javascript Subject: Re: Weak in javascript but stubborn as a mule Date: Sat, 06 Oct 2012 19:20:11 +0200 Lines: 73 Message-ID: References: <506ee544$0$21946$426a34cc@news.free.fr><50700053$0$1734$426a74cc@news.free.fr><50702315$0$6112$426a74cc@news.free.fr> <50704b2c$0$6459$426a74cc@news.free.fr> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-15; format=flowed Content-Transfer-Encoding: 8bit X-Trace: news.uni-berlin.de 4TdJWnpufK2zEawrCN+aAAf0+1cDvsbRHii3jkk4uYpci9XM4= User-Agent: Mozilla/5.0 (X11; Linux i686; rv:15.0) Gecko/20120912 Thunderbird/15.0.1 In-Reply-To: <50704b2c$0$6459$426a74cc@news.free.fr> Xref: csiph.com comp.lang.javascript:16431 On 06.10.2012 17:16, jmrw wrote: > "Denis McMahon" a écrit dans le message de news: > k4pfi3$fkc$2@dont-email.me... >> On Sat, 06 Oct 2012 14:24:56 +0200, jmrw wrote: >> >>> "Evertjan." a écrit dans le message de >>> news: XnsA0E47C8E671D9eejj99@194.109.133.133... >>>> jmrw wrote on 06 okt 2012 in comp.lang.javascript: >>>> >>>>> On my page http://www.jmrw.com/Chess/Tableau_echecs/index.htm >>>>> >>>>> I would like to place the legend - listeOeuvres[6*compteur] - under >>>>> the painting. >>>>> >>>>> I am sure it is not difficult, >>>> >>>> So why ask, >>>> such difficulty should surly be measured according to your skill? >>>> >>>>> but how to do? >>>> >>>> Presuming you want to have different texts under different images, >>>> with a step 6 incrementing counter ok it? >>>> [with a fixed text it is just html and off topic here in this NG] >>>> >>>> You could make a seperate
that you fill at the same time with a >>>> text from a database or array, as you change the image. >>>> >>>> Please do not ask us to do your coding from scratch. >>>> >>>> -- >>>> Evertjan. >>>> The Netherlands. >>>> (Please change the x'es to dots in my emailaddress) >>> >>> I made a div :
>>> >>> I try to fill it with : function fill_div() >>> {document.getElementById('legende').innerHTML=listeOeuvres[6*Compteur >> +1]}; >>> >>> It doesn't work probably beaucause it is completly supid. >> >> The listeOeuvres[6*Compteur+1] is a text literal, it needs "" or '' round >> it. >> >> The ";" comes after the line of javascript inside the function. >> >> Try: >> >> // code starts here --> >> >> function fill_div() { >> document.getElementById('legende').innerHTML = "listeOeuvres[6*Compteur >> +1]"; >> } >> >> // <-- code ends here > > Thanks but this write listeOeuvres[6*Compteur> +1] on my page ! > What browser are you using? Try to find out how to access the place where it shows script errors, most browsers today have that. In firefox you can press Ctrl+Shift+J to open its error console for example. With your original fill_div function in the code it should say something like "Compteur is not defined", because names in this language are case-sensitive and you only defined 'compteur'. -- Jake Jarvis