请教一个ajax里面的url怎么写
chbwl 2016-08-28 12:04:52 inc.php里面的代码
<?php
/********************************************************
* @author Kyler You <QQ:2444756311>
* @link http://mp.weixin.qq.com/wiki/home/index.html
* @version 2.0.1
* @uses $wxApi = new WxApi();
* @package 微信API接口 陆续会继续进行更新
********************************************************/
class WxApi {
const appId = "1";
const appSecret = "f";
const mchid = "1"; //商户号
const privatekey = "9"; //私钥
public $parameters = array();
public $jsApiTicket = NULL;
public $jsApiTime = NULL;
public function __construct(){
}
public function getCardDetail(){
if(!isset($_POST['card_id'])){
$access_token = $this->wxAccessToken();
$url4 = 'https://api.weixin.qq.com/card/get?access_token='.$access_token;
//$s = json_encode(array('card_id'=>$_POST['card_id']));
$s = json_encode(array('card_id'=>pRGOyjvkINXZN3aVD6GYB15afLd4));
$r = $this->http_post_data($url4,$s);
//echo $r[1];
return $r[1];
}
}
}
index 里面的
$.ajax({
type: 'post',
url: '',
data: {
card_id: 123456789
},
dataType: 'json',
success: function(da) {
alert (JSON.stringify(da));
}
--------------------------------
我想通过index吧card_id里面的内容传给inc.php 让 public function getCardDetail() 这段运行吧结果返回给index里面,请问这个URL怎么写 ? 直接写inc.php吗? success里面这样写行吗?