Mhttpd.js: Difference between revisions

From MidasWiki
Jump to navigation Jump to search
(The midas documentation has moved to https://midas.triumf.ca/docs/)
Tag: Replaced
 
(115 intermediate revisions by 3 users not shown)
Line 1: Line 1:
= About =
The midas documentation has moved. The new documentation about the midas JavaScript library is in:
 
* [https://midas.triumf.ca/docs/develop/api/javascript/ Midas JavaScript API] (overview of the libraries)
mhttpd.js contains javascript function wrappers for most MIDAS AJAX functions typically used for implementing interactive custom pages for MIDAS experiments.
* [https://midas.triumf.ca/docs/develop/api/javascript/midas/ midas.js] (the mjsonrpc_xxx JSON-RPC functions)
 
* [https://midas.triumf.ca/docs/develop/api/javascript/deprecated/#ajax-interface AJAX interface] on the Deprecated web features page (the old ODBGet(), ODBSet() etc. functions)
AJAX is a set of web development techniques used to construct interactive web applications:
* http://en.wikipedia.org/wiki/Ajax_(programming)
 
mhttpd.js is typically served by mhttpd from $MIDASSYS/resources/mhttpd.js
<pre>
<html>
<head>
...
<script src='mhttpd.js'></script>
...
</head>
...
</html>
</pre>
 
A mostly up to date copy of mhttpd.js is linked here:
* http://ladd00.triumf.ca/~daqweb/doc/midas/resources/mhttpd.js
 
An example for using all mhttpd.js functions is included in the MIDAS distribution under examples/javascript1:
 
* http://ladd00.triumf.ca/~daqweb/doc/midas/examples/javascript1/
* http://ladd00.triumf.ca/~daqweb/doc/midas/examples/javascript1/example.html
 
MIDAS AJAX functions can be accessed directly without using mhttpd.js wrappers (i.e. using the JSON-P script-tag method)
 
* [[AJAX]] - MIDAS AJAX functions
 
= Functions =
 
Helper functions:
 
* function getMouseXY(e)
* function XMLHttpRequestGeneric()
 
ODB access functions:
 
* function ODBSet(path, value, pwdname)
* function ODBGet(path, format, defval, len, type)
* function ODBMGet(paths, callback, formats)
* function ODBGetRecord(path)
* function ODBExtractRecord(record, key)
* function ODBKey(path)
* function ODBCopy(path, format)
* function ODBEdit(path)
 
MIDAS access functions:
 
* function ODBRpc_rev0(name, rpc, args)
* function ODBRpc_rev1(name, rpc, max_reply_length, args)
* function ODBGetMsg(n)
* function ODBGenerateMsg(m)
* function ODBGetAlarms()
 
= Summary table =
 
{| class="wikitable"
|+ Summary of mhttpd.js functions
| Function || XML || JSON || JSON-P || async || AJAX||
|-
| ODBSet(path, value, pwdname) || no || no || no || no || cmd=jset
|-
|ODBGet(path, format, defval, len, type) || no || no || no || no || cmd=jget
|-
| ODBMGet(paths, callback, formats)
|-
ODBGetRecord(path)
ODBExtractRecord(record, key)
ODBKey(path)
ODBCopy(path, format)
ODBEdit(path)
ODBRpc_rev0(name, rpc, args)
ODBRpc_rev1(name, rpc, max_reply_length, args)
ODBGetMsg(n)
ODBGenerateMsg(m)
ODBGetAlarms()
|}

Latest revision as of 22:01, 30 October 2026

The midas documentation has moved. The new documentation about the midas JavaScript library is in: