Difference between revisions of "Template:Ajax"

From DFM Wiki
(Created page with "<div id="ajax_load" style="border:solid 1px #eee; padding:1em;"> {{{instructions|Press the button below to load.}}} <span class="mw-ui-button mw-ui-progressive" id="ajax-butt...")
 
 
Line 1: Line 1:
<div id="ajax_load" style="border:solid 1px #eee; padding:1em;">
+
<includeonly><div id="ajax_load" style="border:solid 1px #eee; padding:1em;">
 
{{{instructions|Press the button below to load.}}}
 
{{{instructions|Press the button below to load.}}}
  
 
<span class="mw-ui-button mw-ui-progressive" id="ajax-button" data-uri="{{{script}}}" role="button">{{{action|run}}}</span></span>
 
<span class="mw-ui-button mw-ui-progressive" id="ajax-button" data-uri="{{{script}}}" role="button">{{{action|run}}}</span></span>
 
</div>
 
</div>
<noinclude>
+
</includeonly><noinclude>
 
<templatedata>
 
<templatedata>
 
{
 
{

Latest revision as of 13:29, 12 July 2021

This template creates a container with a button that, when pressed, will run an external script and load the content returned by that script.

Template parameters

ParameterDescriptionTypeStatus
Instructionsinstructions

Instruction message for the ajax script

Unknownoptional
Scriptscript

Path to the script. This should return html that will be displayed on completion of a successful request.

Example
/cgi-bin/example_script.py
Unknownrequired
Actionaction

Text for the button

Example
Submit
Unknownoptional