%META:TOPICINFO{author="TWikiContributor" date="1179177105" format="1.1" version="1.1"}%
---+!! TWiki AJAX Plugin

*Convenience plugin for [[TWiki:Plugins.TWikiAjaxContrib][TWikiAjaxContrib]].*

%TOC%

%AJAX%

---++ Usage
In a topic write:
<verbatim>
%AJAX%
</verbatim>
to add the necessary javascript library references to the page header.

See TWiki:Plugins.TWikiAjaxContrib for instruction and coding examples.


---+++ Demo
<div style="margin:1em 0;">
<input id="loadButton" class="twikiButton" type="button" value="Load stuff" />

<div>
	<div id="stuffContainer" style="width:300px; height:300px; overflow:auto; padding:10px; border:1px solid #999;"></div>
</div>
</div>

<script type="text/javascript">
// <![CDATA[
var Container = {
	load:function () {
		twiki.AjaxRequest.load("STUFF", {
			container:"stuffContainer",
			url:"%PUBURL%/%TWIKIWEB%/TWikiAjaxContribExamples/test_hamlet.html?"
		});
	}
}

var myrules = {
	'#loadButton' : function(el) {
		el.onclick = function() {
			Container.load();
			return false;
		}
		el = null; // prevent IE leaking
	}
};
Behaviour.register(myrules);
// ]]>
</script>


#PluginSettings
---++ Plugin Settings

Plugin settings are stored as preferences variables. To reference a plugin setting write ==%<nop>&lt;plugin&gt;_&lt;setting&gt;%==, i.e. ==%<nop>FORMPLUGIN_SHORTDESCRIPTION%==

   * One line description, is shown in the %TWIKIWEB%.TextFormattingRules topic:
      * Set SHORTDESCRIPTION = Convenience plugin for TWiki:Plugins.TWikiAjaxContrib

   * Debug plugin: (See output in =data/debug.txt=)
      * Set DEBUG = 0



#PluginTest
---++ Plugin Tests
   * This plugin is %IF{"context TWikiAjaxPluginEnabled" then='%GREEN%enabled%ENDCOLOR%' else ='%RED%not enabled%ENDCOLOR%'}%.


---++ Plugin Installation Instructions

__Note:__ You do not need to install anything on the browser to use this plugin. The following instructions are for the administrator who installs the plugin on the server where TWiki is running. 

   * Download the ZIP file from the Plugin web (see below)
   * Unzip ==%TOPIC%.zip== in your twiki installation directory. Content:
     | *File:* | *Description:* |
     | ==data/TWiki/%TOPIC%.txt== | Plugin topic |
     | ==lib/TWiki/Plugins/%TOPIC%.pm== | Plugin Perl module |



---++ Plugin Info

|  Plugin Author: | TWiki:Main.ArthurClemens |
|  Plugin Version: | 1.0.1, 23 Aug 2007  |
|  Change History: | <!-- versions below in reverse order -->&nbsp; |
|  23 Aug 2007 | 1.0.1 Fixed leftover static file references. |
|  28 May 2007 | 1.0 First release. |
|  TWiki Dependency: | $TWiki::Plugins::VERSION 1.1 |
|  CPAN Dependencies: |- |
|  Other Dependencies: |- |
|  Perl Version: | 5.005 |
|  License: | GPL ([[http://www.gnu.org/copyleft/gpl.html][GNU General Public License]]) |
|  [[TWiki:Plugins/Benchmark][Benchmarks]]: | %TWIKIWEB%.GoodStyle nn%, %TWIKIWEB%.FormattedSearch nn%, %TOPIC% nn% |
|  Plugin Home: | http://TWiki.org/cgi-bin/view/Plugins/%TOPIC% |
|  Feedback: | http://TWiki.org/cgi-bin/view/Plugins/%TOPIC%Dev |
|  Appraisal: | http://TWiki.org/cgi-bin/view/Plugins/%TOPIC%Appraisal |

__Related Topics:__ %TWIKIWEB%.TWikiPreferences, %TWIKIWEB%.TWikiPlugins

