<h3>test datagrand</h3>
<div>
<form method="get" action="
https://data.datagrand.com/share/sms/getverify" >
<div>Mobile:<br />
<input type="text" name="phone" id="mobile" value="10086">
<input type="text" name="piccode" id="datagrand_piccode" value="">
</div>
<input type="submit" value="Msg!" name="submit">
<input type="button" value="Get Piccode" onclick="GetDatagrandPiccode('datagrand_piccode');">
</form>
</div>
</body>
</html>
<script language="javascript">
function GetDatagrandPiccode(inputid)
{
var requestURL = '
https://data.datagrand.com/share/user/getPicVerify'; var request = new XMLHttpRequest();
request.open('GET', requestURL);
request.responseType = 'json';
request.withCredentials = true;
request.onreadystatechange = function()
{
document.getElementById(inputid).value=request.response.PicCode;
};
request.send();
}