jquery.ajax.跨域

ajax跨域请求会自动转化为get方式提交 与前端设置方式无关
前端请求:
$.ajax({

			//url:'jsonp.php',
			url:'http://test.jsonp.cn:10000/index.php?r=portal/register/test',
			type:'post',
			dataType:'script',
			success:function(){
				var json = result_json;
				alert(json.code);
			}
	})
后台处理:
public function actionTest()
   {
      echo 'var result_json='.json_encode(array('code'=>'000000','message'=>'success'));
      exit;

   }
相关文章
相关标签/搜索