head	1.5;
access;
symbols;
locks; strict;
comment	@# @;


1.5
date	2011.07.07.21.48.52;	author TWikiContributor;	state Exp;
branches;
next	1.4;

1.4
date	2010.06.05.07.12.52;	author TWikiContributor;	state Exp;
branches;
next	1.3;

1.3
date	2010.05.29.14.44.35;	author TWikiContributor;	state Exp;
branches;
next	1.2;

1.2
date	2008.01.22.03.21.23;	author TWikiContributor;	state Exp;
branches;
next	1.1;

1.1
date	2006.06.25.16.26.27;	author TWikiContributor;	state Exp;
branches;
next	;


desc
@buildrelease
@


1.5
log
@buildrelease
@
text
@%META:TOPICINFO{author="TWikiContributor" date="1310075332" format="1.1" version="5"}%
---+ Using HTML, CSS and !JavaScript

%STARTINCLUDE%
You can use most HTML tags in TWiki topics without a problem. This is useful where you want to add some content that is formatted in a way that is not supported using [[#TWikiShorthand][TWiki shorthand]], for example, you can write =&lt;strike&gt;deleted text&lt;/strike&gt;= to get <strike>deleted text</strike>.

There are a few usability and technical considerations to keep in mind:

   * On collaboration pages, it's better *not* to use HTML, but to use TWiki shorthand instead - this keeps the text uncluttered and easy to edit using the plaintext editor.
   * If you _must_ use HTML, use [[http://www.w3.org/TR/xhtml1/][XHTML 1.0 Transitional]] syntax.
   * Use =&lt;literal&gt;..&lt;/literal&gt;= tags around blocks of HTML to avoid accidental interpretation of TWiki shorthand within the HTML.
   * %X% Script tags may be filtered out, at the discretion of your TWiki administrator.

Recommendations when pasting HTML from other sources (using the plain-text editor):

   * Copy only text between =&lt;body&gt;= and =&lt;/body&gt;= tags.
   * Remove all empty lines. TWiki inserts =&lt;p /&gt;= paragraph tags on empty lines, which causes problems if done between HTML tags that do not allow paragraph tags, like for example between table tags.
   * Remove leading spaces. TWiki might interpret some text as lists.
   * Do not span a tag over more than one line. TWiki requires that the opening and closing angle brackets - ==&lt;...&gt;== - of a HTML tag are on the same line, or the tag will be broken.
   * In your HTML editing program, save without hard line breaks on text wrap.

When using a WYSIWYG editor, you can just copy-paste directly into the editor, and the content will be converted to TWiki shorthand automatically when you save.

It is also possible to add Cascading Style Sheets ([[http://en.wikipedia.org/wiki/Cascading_Style_Sheets][CSS]]) and [[http://en.wikipedia.org/wiki/JavaScript][JavaScript]] code to TWiki pages, which can be used to make TWiki application more interactive. To prevent TWiki from interpreting some text as markup, it can be enclosed in HTML-escaped <tt>&lt;pre&gt;</tt>-tags.

<table border="0" cellpadding="5" cellspacing="10">
<tr bgcolor="#DDDDDD"><th valign="top">
!JavaScript Example:
</th><th valign="top">
CSS Example:
<tr bgcolor="#EEEEEE"><td valign="top">
<verbatim>
<!-- <pre> -->
<script language="javascript">
<!--
  // put your JavaScript code here
//-->
</script>
<!-- </pre> -->
</verbatim>
</td><td valign="top">
<verbatim>
<!-- <pre> -->
<style type="text/css">
  /* put your CSS code here */
</style>
<!-- </pre> -->
</verbatim>
</td></tr></table>
%STOPINCLUDE%

__Related topics:__ TextFormattingRules, TWikiShorthand

-- __Contributors:__ TWiki:Main/KennethLavrsen, TWiki:Main/PeterThoeny
@


1.4
log
@buildrelease
@
text
@d1 1
a1 1
%META:TOPICINFO{author="TWikiContributor" date="1275721972" format="1.1" version="4"}%
d28 2
a30 2
</th><th valign="top">
!JavaScript Example:
@


1.3
log
@buildrelease
@
text
@d1 2
a2 2
%META:TOPICINFO{author="TWikiContributor" date="1269909319" format="1.1" version="3"}%
---++ Using HTML, CSS and !JavaScript
d5 1
a5 3
You can use most HTML tags in TWiki topics without a problem. This is useful where you want to
add some content that is formatted in a way that is not supported using [[#TWikiShorthand][TWiki shorthand]], for example,
you can write =&lt;strike&gt;deleted text&lt;/strike&gt;= to get <strike>deleted text</strike>.
d8 2
a9 2
   * On collaboration pages, it's better *not* to use HTML, but to use [[#TWikiShorthand][TWiki shorthand]] instead -
     this keeps the text uncluttered and easy to edit using the plaintext editor.
d11 1
a11 2
   * Use =&lt;literal&gt;..&lt;/literal&gt;= tags around blocks of HTML to avoid accidental interpretation of
     [[#TWikiShorthand][TWiki shorthand]] within the HTML.
d15 1
d22 1
a22 2
When using a WYSIWYG editor, you can just copy-paste directly into the editor, and the content will
be converted to [[#TWikiShorthand][TWiki shorthand]] automatically when you save.
d51 4
@


1.2
log
@buildrelease
@
text
@d1 2
a2 2
%META:TOPICINFO{author="TWikiContributor" date="1141756239" format="1.1" version="2"}%
---++ Using HTML
d27 26
@


1.1
log
@buildrelease
@
text
@d1 1
a1 1
%META:TOPICINFO{author="TWikiContributor" date="1141756239" format="1.1" version="1"}%
d5 3
a7 1
You can use just about any HTML tag without a problem. You can add HTML if there is no TWiki equivalent, for example, write =&lt;strike&gt;deleted text&lt;/strike&gt;= to get <strike>deleted text</strike>.
d9 6
a14 3
%X% There are a few usability and technical considerations to keep in mind:
   * On collaboration pages, it's better *not* to use HTML, but to use [[#TWikiShorthand][TWiki shorthand]] instead - this keeps the text uncluttered and easy to edit.
   * If you use HTML use [[http://www.w3.org/TR/xhtml1/][XHTML 1.0 Transitional]] syntax.
d17 1
a17 1
Recommendations when pasting HTML from other sources:
d21 1
a21 1
   * Do not span a tag over more than one line. TWiki requires that the opening and closing angle brackets - ==&lt;...&gt;== - of an HTML tag are on the same line, or the tag will be broken.
d24 2
a25 1
%T% TWiki converts shorthand notation to HTML for display. To copy a fully marked-up page, simply view the source in your browser and save the contents. If you need to save HTML frequently, you may want to check out TWiki:Plugins/PublishAddOn.
@
