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


Groups > comp.lang.javascript > #29060 > unrolled thread

Re: "weekly" javascript?

Started byDr J R Stockton <reply1500@merlyn.demon.co.uk.invalid>
First post2015-12-28 16:15 +0000
Last post2015-12-28 16:15 +0000
Articles 1 — 1 participant

Back to article view | Back to comp.lang.javascript

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

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

#29060 — Re: "weekly" javascript?

FromDr J R Stockton <reply1500@merlyn.demon.co.uk.invalid>
Date2015-12-28 16:15 +0000
SubjectRe: "weekly" javascript?
Message-ID<wq21fa32AWgWFwHY@invalid.uk.co.demon.merlyn.invalid>
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.

[toc] | [standalone]


Back to top | Article view | comp.lang.javascript


csiph-web