html 调用手机发短信功能语句

html-css09

html 调用手机发短信功能语句,第1张

html 调用手机发短信功能语句如下:

1、建立短信模板

2、html页面加入以下代码:

<form action="servlet/Sim_servlet?action=SendSms" method="post">

电话号码:<input type="text" name="mobile">

内容:<input type="text" name="message">

<input type="submit" name="submit" value="提交">

</form>

3、后台通过短信模板处理:

String mobile=request.getParameter("mobile")

String message1=request.getParameter("message")

String message=java.net.URLEncoder.encode(message1)

String action=request.getParameter("action")

String pw="xxx"//私人密码

String ID="xxx"//用户id

String URL="http://www.72dns.com/smsadmin/Sms_Api.aspx?"

String last=URL+"UserID="+ID+"&PassWord="+pw+"&mobile="+mobile+"&message="+message+"&action="+action

response.sendRedirect(last)

html5 postmessage的传参使用方法:

1、在html5中,要实现跨域页面间的数据互访,需要调用对象的postMessage方法,其调用格式如下:

参数说明如下:

参数otherWindow为接收数据页面的引用对象,可以是window.open的返回值,也可以是iframe的contentWindow属性或通过下标返回的window.frames单个实体对象;

参数message表示所有发送的数据,字符类型,也可以是JSON对象转换后的字符内容;

参数targetOrigin表示发送数据的URL来源,用于限制otherWindow对象接受范围,如果该值为通配符*号,则表示不限制发送来源,指向全部的地址。

2、下面通过实例介绍使用PostMessage()方法实现跨文档传输数据的过程。