最近中文字幕高清中文字幕无,亚洲欧美高清一区二区三区,一本色道无码道dvd在线观看 ,一个人看的www免费高清中文字幕

為了賬號安全,請及時綁定郵箱和手機立即綁定
已解決430363個問題,去搜搜看,總會有你想問的

Vue.js2.x版本,get和jsonp都無法獲得數(shù)據(jù)不

Vue.js2.x版本,get和jsonp都無法獲得數(shù)據(jù)不

EugenioCode 2017-04-16 14:42:02
get請求代碼如下:<!DOCTYPE?html> <html?lang="en"> <head> ????<meta?charset="UTF-8"> ????<title>vue入門</title> ????<script?src="vue.js"></script> ????<script?src="vue-resource.js"></script> ????<script> ????????window.onload?=??function?()?{ ????????????new?Vue({ ????????????????el:'#box', ????????????????data:{ ????????????????}, ????????????????methods:{ ????????????????????get:function?()?{ ????????????????????????this.$http.get('./get.php',{a:2,b:1}).then(function?(res)?{ ????????????????????????????alert(res.data) ????????????????????????},function?(res)?{ ????????????????????????????alert(res.status); ????????????????????????}) ????????????????????} ????????????????} ????????????}) ????????} ????</script> </head> <body> <div?id="box"> ????<input?type="button"?value="獲取"?@click="get()"> </div> </body> </html>php代碼如下:<?php $a?=?$_GET["a"]; $b?=?$_GET["b"]; echo?$a+$b;jsonp函數(shù)如下:jsonp:function?()?{ ????this.$http.jsonp('https://sug.so.#/suggest',{ ????????word:"a", ????},{emulateJSON:true}).then(function?(res)?{ ????????alert(res.data.s); ????},function?(res)?{ ????????alert(res.status); ????}) }兩個都無法拿到數(shù)據(jù)
查看完整描述

目前暫無任何回答

  • 0 回答
  • 0 關(guān)注
  • 2648 瀏覽
慕課專欄
更多

添加回答

舉報

0/150
提交
取消
微信客服

購課補貼
聯(lián)系客服咨詢優(yōu)惠詳情

幫助反饋 APP下載

慕課網(wǎng)APP
您的移動學習伙伴

公眾號

掃描二維碼
關(guān)注慕課網(wǎng)微信公眾號