V 4000 ue jsonp交互
2017-02-15 23:16
323 查看
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <title>jsonp</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="../js/Vue.js"></script> <script src="../js/vue-resource.js"></script> <script> window.onload=function(){ new Vue({ el:'#box', data:{ }, methods:{ get:function(){ 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> <div id="box"> <input type="button" value="按钮" @click="get()"> </div> </body> </html>
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <title>jsonp</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="../js/Vue.js"></script> <script src="../js/vue-resource.js"></script> <script> window.onload=function(){ new Vue({ el:'#box', 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> <div id="box"> <input type="button" value="按钮" @click="get()"> </div> </body> </html>
相关文章推荐
- 解决方案,而不是功能【交互设计】
- 用户与 Oracle DB 交互详细过程
- 带交互的telnet小工具,golang版
- chrome开发总结(交互/权限/存储)-爬虫 - 宁静致远_ - 博客园
- 设计公式:简单有效的竞品分析【交互设计, 用户研究】
- C/C++与Lua之间进行数据函数交互以及解决“PANIC: unprotected error in call to Lua API (attempt t
- Android 客户端与服务器端进行数据交互(一、登录服务器端)
- bot framework2——与用户交互
- Winform中长时间处理时良好的交互界面呈现_多线程
- web前后台的参数交互方式
- DayDayUP_Python自学记录[13]_Python MySQL 交互
- TCP传输中序号与确认序号的交互
- BlazDS与JAVA交互实例
- 【交互设计】手势驱动的界面设计
- WebAPP与原生APP的交互设计区别
- angualrjs,指令和控制器之间的交互,实现指令的复用
- Android界面与交互设计原则
- 【学习13】Cocos2d-x物理按键交互
- iOS 与H5交互
- Android系列之SQLite与Android Studio的数据交互