Webtags (preserving history): Difference between revisions

Line 16: Line 16:


=== Using web tags in scripts ===
=== Using web tags in scripts ===
*You can also use the tags within script, either embedded in HTML, or in external files, to transfer the values represented by the tags to the server for further processing.
*You can also use the tags within script, this might be a PHP script, or JavaScript either embedded in HTML, or in external files, to transfer the values represented by the tags to the server for further processing.
*As JavaScript can not understand a real number that has the integer and decimal parts separated by a comma, but your computer may be set to use that representation in standard tags, there are special versions of many tags to use in script - see [[#No_Commas|tags with commas removed]] section.
*As JavaScript can not understand a real number that has the integer and decimal parts separated by a comma, but your computer may be set to use that representation in standard tags, there are special versions of many tags to use in script - see [[#No_Commas|tags with commas removed]] section.
*Note that if a script contains any Cumulus web tags then you must [[Customised_templates#What_to_select_on_the_.27Files.27_tab_of_the_Internet_Settings_screen_within_the_.27Configuration.27_menu|ask Cumulus to process]] the script file.
*Note that if a PHP or Javascript file contains any Cumulus web tags then you must [[Customised_templates#What_to_select_on_the_.27Files.27_tab_of_the_Internet_Settings_screen_within_the_.27Configuration.27_menu|ask Cumulus to process]] the script file.
*The whole script can be embedded in a template that is already being processed into HTML. (This technique has been used  in the standard 'monthlyrecordT.htm' template).
*JavaScript processing code can be embedded in a template that is already being processed into HTML. (This technique has been used  in the standard 'monthlyrecordT.htm' template).
*Alternatively embed a bit of script in HTML that is already been processed to convert the tags to a collection of string variables and use those variable names in any external script called from the HTML file. (This technique has been used in the standard 'gaugesT.htm' template).
*Alternatively embed a bit of JavaScript assignment code in HTML, that is already been processed, to convert the tags to a collection of string variables and use those variable names in any external script called from the HTML file. (This technique has been used in the standard 'gaugesT.htm' template).
*Finally, remember that to use the value from a tag as an integer you need to use a  
*To use the value from a tag as an integer in JavaScript assigning code you need to use a  
<pre>integer_variable_name=parseInt(string_variable_name,10)</pre> type conversion (or apply '*1', i.e. multiply by one, to implicitly convert the tag from string to base 10 number).
<pre>integer_variable_name=parseInt(string_variable_name,10)</pre> type conversion
*Alternatively, in most script languages, apply '*1', i.e. multiply by one, to implicitly convert the tag from string to base 10 number.


=== Differences for Webtags in MX builds ===
=== Differences for Webtags in MX builds ===
5,838

edits