<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>智能社——http://www.zhinengshe.com</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0">
<meta name="apple-mobile-web-app-capable" content="yes">
<meta name="apple-mobile-web-app-status-bar-style" content="black">
<style> </style>
<script src="vue.js"></script>
<script src="vue-resource.js"></script>
<script>
window.onload=function(){
new Vue({
el:'body',
data:{ },
methods:{
get:function(){
this.$http.get('a.txt',{
a:1,
b:2
},{
emulateJSON:true//加这个参数才能post发送数据
}).then(function(res){
alert('成功了');
alert(res.data);
},function(res){
alert('失败了');
alert(res.data);
alert(res.status);
});
}
}
});
};
</script>
</head>
<body>
<input type="button" value="按钮" @click="get()">
</body>
</html>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>智能社——http://www.zhinengshe.com</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0">
<meta name="apple-mobile-web-app-capable" content="yes">
<meta name="apple-mobile-web-app-status-bar-style" content="black">
<style> </style>
<script src="vue.js"></script>
<script src="vue-resource.js"></script>
<script>
window.onload=function(){
new Vue({
el:'body',
data:{ },
methods:{
get:function(){//jsonp跨域访问
this.$http.jsonp('https://sug.so.360.cn/suggest',{
word:'a'
}).then(function(res){
alert(res.data.s);
},function(res){
alert(res.status);
});
}
}
});
};
</script>
</head>
<body>
<input type="button" value="按钮" @click="get()">
</body>
</html>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>智能社——http://www.zhinengshe.com</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0">
<meta name="apple-mobile-web-app-capable" content="yes">
<meta name="apple-mobile-web-app-status-bar-style" content="black">
<style> </style>
<script src="vue.js"></script>
<script src="vue-resource.js"></script>
<script>
window.onload=function(){
new Vue({
el:'body',
data:{ },
methods:{
get:function(){
this.$http.jsonp('https://sp0.baidu.com/5a1Fazu8AA54nxGko9WTAnF6hhy/su',{
wd:'a'
},{
jsonp:'cb' //callback名字
}).then(function(res){
alert(res.data.s);
},function(res){
alert(res.status);
});
}
}
});
};
</script>
</head>
<body>
<input type="button" value="按钮" @click="get()">
</body>
</html>

最新文章

  1. 解决mysql插入数据时出现Incorrect string value: &#39;\xF0\x9F...&#39; for column &#39;name&#39; at row 1的异常
  2. Spring中常用类型的bean配置(Map,List,Set,基本类型)
  3. Webdriver配合Tesseract-OCR 自动识别简单的验证码
  4. cocostudio 骨骼动画 setContentScaleFactor
  5. EmguCV 如何从数组中创建出IntPtr
  6. C#使用ICSharpCode.SharpZipLib.dll压缩文件夹和文件
  7. 在WPF控件上添加Windows窗口式调整大小行为
  8. 用正则表达式在注册页面(js/aspx.cs)的验证
  9. [翻译][MVC 5 + EF 6] 4:弹性连接和命令拦截
  10. hibernate官方新手教程 (转载)
  11. New Year Permutation(Floyd+并查集)
  12. js对象字面量
  13. 图解vue生命周期
  14. tomcat自动运行磁盘任意位置上的项目、使用Maven对tomcat进行自动部署
  15. node命令行工具—cf-cli
  16. 剑指Offer 17. 树的子结构 (二叉树)
  17. Redis基础认识及常用命令使用(一)--转载
  18. c# 泛型的应用
  19. 如何使用seajs+jQuery构建中型项目
  20. Eclipse中创建java类的时候自动设置作者信息和创建时间

热门文章

  1. 华为P30系列新增“无线投屏”功能
  2. python 正则表达式与re模块
  3. 中国象棋程序的设计与实现(六)--N皇后问题的算法设计与实现(源码+注释+截图)
  4. 解决jquery动态增加元素后children值没有变的问题
  5. 面向对象设计(OOD)七大原则
  6. CodeForces 550B Preparing Olympiad(DFS回溯+暴力枚举)
  7. 由老同事学习SAP所想到的
  8. SPOJ1812: LCS2 - Longest Common Substring II &amp; BZOJ2946: [Poi2000]公共串
  9. springboot actuator shutdown正确的关闭操作
  10. Java Web应用定制404错误页面