Tue Apr 24, 2012 12:01 pm
JavaScript runs on a browser (the HTTP client), not the router (the HTTP server), so there's no way MikroTik could do that, and if they did do something similar (e.g. send aribitrary commands to a special URL on the router's HTTP server), it would be very insecure, as you're essentially allowing the client to do whatever they want.
If the HTTP server supported a server scripting engine (JSP, PHP, a proprtietary language), you would've been able to do that, but there's no such support, and AFAIK, no plans to add such (beyond the pseudo server language for outputting hotspot variables that is).
You could always make the router redirect or dst-nat to a separate web server that controls it via the API protocol. The end user wouldn't know (or care about) the difference.
PEAR2_Net_RouterOS(1.0.0b6) - My API client in PHP
(Rate my posts? If you want... no pressure...)