Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.javascript > #29060

Re: "weekly" javascript?

From Dr J R Stockton <reply1500@merlyn.demon.co.uk.invalid>
Newsgroups comp.lang.javascript
Subject Re: "weekly" javascript?
Date 2015-12-28 16:15 +0000
Organization Home
Message-ID <wq21fa32AWgWFwHY@invalid.uk.co.demon.merlyn.invalid> (permalink)
References <super70s-3DE5C2.10244827122015@reader.albasani.net> <XmlHttpRequest-JSON-DHTML-20151227174128@ram.dialup.fu-berlin.de>

Show all headers | View raw


In comp.lang.javascript message <XmlHttpRequest-JSON-DHTML-
20151227174128@ram.dialup.fu-berlin.de>, Sun, 27 Dec 2015 17:12:08,
Stefan Ram <ram@zedat.fu-berlin.de> posted:

>super70s <super70s@super70s.invalid> writes:
>>I was just wondering if there's a good JS I could use for this, say put
>>all 52 weekly items in a separate file and then have the appropriate
>>item come up according to what week it is?
>>I just don't know if this could work with the HTML markup that's
>>required for the above, when I tried to insert HTML (say, bold text) for
>>the birthday one, it wouldn't work at all.
>
>  The following example shows how to insert a strong element
>  read from a file ›example‹.

String is most useful when it is strong, or sometimes when it is strung.

There is an easier way to read data from a file, if that file can be
suitably prepared :

In the main page, something like

<script type="text/javascript" src="chron16.js"></script>

and in adjacent file chron16.js, for example,

var clndr = [,
  msg01,
  msg02,
  ...
  msg53 ]
where each msg is a string literal (or, more elegantly, an Object of
strings) -

together with any other variables wanted.

The OP might consult
<http://web.archive.org/web/20150907215801/http://www.merlyn.demon.co.uk
/weekcalc.htm>.

-- 
 (c) John Stockton, nr London, UK.   E-mail, see Home Page.    Turnpike v6.05.
 Website  <                              > - w. FAQish topics, links, acronyms
 PAS EXE etc. : <                              programs/> - see in 00index.htm
 Dates - miscdate.htm estrdate.htm js-dates.htm pas-time.htm critdate.htm etc.

Back to comp.lang.javascript | Previous | Next | Find similar | Unroll thread


Thread

Re: "weekly" javascript? Dr J R Stockton <reply1500@merlyn.demon.co.uk.invalid> - 2015-12-28 16:15 +0000

csiph-web