$.get("__URL__/test",{},function(data){
console.log(data);
});
IndexAction :
public function test(){
echo json_encode(array("test"=>"this is a test"));
}
test.html 中打印出来的 data 是 </sc
然后我不用tp,直接提交给同目录下的.php:
test.html :
$.get("tt.php",{},function(data){
console.log(data);
});
tt.php :
<?php
echo json_encode(array("test"=>"this is a test ~~~"));
最后输出的data是:json : {"test":this is a test ~~~"}
我的是mac系统,在另一台windows环境中的tp上运行是正常的,为啥我这电脑上的tp就是不行?真的搞不懂~~~请各位大神解答一下~~~
最佳答案