Webtags (preserving history): Difference between revisions

m
Line 696: Line 696:
== "GET" approach ==
== "GET" approach ==


You may have used GET as an attribute when defining the action of a HTML form.  Equally you might in a script language access the query-string part of a Universal Resource Locator.  Even if you don't understand the meaning of those technical terms, you probably have seen when using a browser a question mark (?) followed by one or [separated by ampersand (&)] more '''name=value''' parameters.
You may have used GET as an attribute when defining the action of a HTML form.  Equally you might in a script language access the query-string part of a Universal Resource Locator to get parameters for what the script is to supply to the web page.  Even if you don't understand the meaning of those technical terms, you probably have seen when using a browser (in the box where a URL is entered) that sometimes the URL seen there has a query-string. You will have seen a question mark (?) followed by one or [separated by ampersand (&)] more '''name=value''' parameters.


The GET approach to using the api works in this way indicating the start of a query-string with a question mark and using ampersands to separate names. The difference is that a tag name is used instead of a name=value parameter.   
The GET approach to using the Cumulus general api works in this way indicating the start of a query-string with a question mark and using ampersands to separate names. The difference is that a tag name (or list of tag names) is used instead of a name=value parameter (or list of name=value parameters).   


Suppose you want to get the values for the following three web tags:
Suppose you want to get the values for the following three web tags:
Line 712: Line 712:


The first parameter is '''rc''' to indicate that the tags that follow are to use decimal points not decimal commas, which is how many script languages expect to see values.  
The first parameter is '''rc''' to indicate that the tags that follow are to use decimal points not decimal commas, which is how many script languages expect to see values.  
Remember that in this version (and some earlier versions) of MX, the above three web tags are exactly same as:
Remember that in current version (and some earlier versions) of MX, the above three web tags are exactly same as:
# <#temp rc=y>
# <#temp rc=y>
# <#hum rc=y>
# <#hum rc=y>
# <#dew rc=y>
# <#dew rc=y>


Since '''rc=y'''  can be applied to several web tags that don't appear in [[Webtags#No_Commas]] table, this shows how the api can access values without commas for many other web tags.
Since '''rc=y'''  can be applied to several web tags that don't appear in [[Webtags#No_Commas]] table, this shows how the api can access values without commas for all those web tags that report in real numbers and allow that output modifier.


If you are using the api in a context where it does not matter if decimal commas or decimal points are in the api, simply omit the '''rc''' as first item, and just include tag names separated by ampersands.
If you are using the api in a context where it does not matter if decimal commas or decimal points are in the api or for any tags that don't report in real numbers, simply omit the '''rc''' as first item, and just include tag names separated by ampersands.


=== JavaScript example ===
=== JavaScript example ===
5,838

edits