Gmi service example, Using javascript – Grandstream GXV3275 GMI Web Service Guide User Manual

Page 45

Advertising
background image

GXV3240/3275 GMI Web Service v1.9 User Guide

Page 44 of 44

GMI SERVICE EXAMPLE

USING JAVASCRIPT

Add the following code in the file webservice.html.

<script language="javascript" src="js/WebService.js"></script>

<script type="text/javascript">

function showLogin(data)

{

if(data.res == "success")

{

$("#connectresult").html("<font color='red'>Connect success</font>");

}

}

function login()

{

ip = $("#ip").val();

username = $("#username").val();

password = $("#password").val();

webService.webServiceLogin(ip, username, password, showLogin);

}

</script>

…...

<div id="connectinfo">

Phone IP: <input id="ip" value="Input Phone IP here">

UserName: <input id="username" value="admin">

Password: <input id="password" value="admin">

<button onclick="login()">Connect</button>

</div>

<br>

<h4>2. Connect info</h4>

<div id="connectresult">

not connected

</div>

….......

Advertising
This manual is related to the following products: