标签:bbs res xmlhttp nbsp cal sync class html array
<script type="text/javascript"> $.ajax({ type:‘get‘, url:"http://www.xxx.com/oep-new/index.php/cast/upcast/"+val, dataType:‘jsonp‘, // async: false, //beforeSend:function(){ //$(‘#cast_order‘).html(imgshow); //}, success:function(data){ alert(data) }, error: function(xmlHttpRequest,error) { } }); </script>
//注意:dataType:的存在,beforeSend是不会执行的。跨域必须get,不能post。跨域请求只能是异步请求设置async: false无效。
public function upcast($dotype=‘‘){ $callback = $_GET[‘callback‘]; // $results = array(1,2,3); // echo $callback . ‘(‘ . json_encode($results) . ‘)‘; echo $callback.‘(1)‘; //返回文本1 }
https://www.zhihu.com/question/19618769
http://bbs.csdn.net/topics/390732999
http://bbs.csdn.net/topics/350109002
标签:bbs res xmlhttp nbsp cal sync class html array
原文地址:http://www.cnblogs.com/zengdiao/p/6069059.html