Quantcast
Channel: Foros de Velneo » Todas las publicaciones
Viewing all articles
Browse latest Browse all 5035

Respuesta a: Algunos web services y envio de variables POST

$
0
0

Hola Gabriel.

Si no quieres aprender el API de Velneo olvídate de XMLHttpRequest porque de lo contrario te vas a atascar con cada línea de código.

Otra solución es usar el API de HTML5 para los Formularios, eso sí, requiere un poco de javascript y conocer el DOM.
Genera el siguiente código HTML en un fichero temporal (con extensión html) y lo cargas en el Visor HTML de la forma habitual.

<html>
<head>
<title> 3R DVR Web 1.0.2.3 </title>
</head>
<script>
   function iniciar() {
      var loginForm = document.getElementById("login")
      var inputUsu = document.getElementById("usu")
      var inputPass = document.getElementById("pass")
      var inputCam = document.getElementById("cam")
      // Inserta los valores preestablecidos del formulario
      inputUsu.setAttribute("value", "<usuario>")
      inputPass.setAttribute("value", "<password>")
      inputCam.setAttribute("value", "<camara>")
      // Envía el Request
      loginForm.submit()
   }
   window.addEventListener("load", iniciar, false);
</script>
<body>
<FORM id=login name="mobile_login" METHOD="POST" ACTION="http://181.48.49.26/login.cgi">
<table width="250" height="100" border="0">
  <tr>
    <td>ID</td>
    <td> <INPUT id=usu TYPE=text NAME=id size=15></td>
  </tr>
  <tr>
    <td>Password</td>
    <td><INPUT id=pass TYPE=password NAME=passwd size=15></td>
  </tr>
  <tr>
    <td>Camera(1~4)</td>
    <td> <INPUT id=cam TYPE=text NAME=camera size=15> </td>
  </tr>
  <tr>
    <td></td>
    <td><INPUT TYPE=submit value = "Login"></td>
  </tr>
</table>
</FORM>
</body>
</html>

Es otra solución más, aunque habrá cientos.

Saludos
Paco Satué


Viewing all articles
Browse latest Browse all 5035

Trending Articles