|
Cookbook /
JavaScriptSummary: Embed (static) JavaScript into wiki pages
Version: 2006-07-17
Prerequisites:
Status: Stable
Maintainer: Pm
Categories: Markup
Questions answered by this recipe
(For information about using wiki markup to create or edit JavaScript, see JavaScript-Editable.)
DescriptionGetting JavaScript into a wiki page is easily done by creating a custom markup for it. For example, weather.com provides me with the following JavaScript code for displaying weather information on a webpage: <script src='http://voap.weather.com/weather/oap/75025?template=LAWNH&par=null&unit=0&key=77351fbfbbfc1099f80fa310e5f58b52'></script>
So, to create a custom
Markup('weather', 'directives',
'/\\(:weather:\\)/',
Keep("<script src='http://voap.weather.com/weather/oap/75025?template=LAWNH&par=null&unit=0&key=77351fbfbbfc1099f80fa310e5f58b52'></script>"));
This results in:
NotesCommentsVery nice! Thanks for the code. Jeff M See AlsoContributors
|