通过javascript向手机发送消息
Send message to mobile through javascript
我是javascript新手,我想用javascript向移动设备发送消息在PHP中,这可以通过以下代码来完成
$number = 'your-number';
$url = "http://pointsms.in/API/sms.php?username=[xxxxxx]&password=[xxxxxx]&from=[xxxxxxxx]&to=[xxxxxxxxxx]&msg=[xxxx]&type=1&dnd_check=0";
fopen($url, 'r');
但我正在使用opencart,我想使用javascript 执行此操作
在javascript中,我使用window.location在window中打开url但我不想在窗口打开
window.location.replace('http://pointsms.in/API/sms.php?username=[xxxxxx]&password=[xxxxxx]&from=[xxxxxxxx]&to=[xxxxxxxxxx]&msg=[xxxx]&type=1&dnd_check=0');
请帮助解决此问题
尝试使用AJAX。
点击此处阅读更多信息:http://www.w3schools.com/ajax/ajax_examples.asp
var xhr = new XMLHttpRequest()
xhr.open('GET', 'http://pointsms.in/API/sms.php?username=[xxxxxx]&password=[xxxxxx]&from=[xxxxxxxx]&to=[xxxxxxxxxx]&msg=[xxxx]&type=1&dnd_check=0', true)
xhr.send()
相关文章:
- Ajax聊天消息重复而不仅仅是更新
- 如果localstorage为空,则显示欢迎消息
- 绑定时将Parsley minlength消息作为选项传递时,未对其进行自定义
- 离开页面时弹出消息
- 有没有一种方法可以在控制台关闭的情况下让console.log()在IE中记录消息
- 从手机中选择多个图像'使用phonegap的多媒体资料
- 消息显示之外的淘汰验证
- 选项卡侦听器未被来自后台脚本的消息激活
- jQuery在输入下验证post错误消息
- Scipt未在选定选项卡中执行以发送和接收消息
- 检查xmlhttprequest问题的消息
- AngularJs对ng消息的自定义替换
- ng消息仅在触摸时显示错误,并在错误的初始显示上转换
- 如何使用手机浏览器上的按钮拨打USSD代码
- 当用户按下回车键时,自动在text区域/text中插入消息
- 如果消息框答案为YES,则用Javascript填写表单
- 在苹果手机野生动物园浏览器中,加载包含href的javascript时收到错误消息
- 需要显示关于手机的验证错误消息
- 通过javascript向手机发送消息
- 需要发送消息到手机号码,国际号码,也使用php国家号码