ajax

来源:互联网 发布:数据库工程师培训机构 编辑:程序博客网 时间:2024/06/05 05:38

一. angular

1. $http({

method:'get / post ',

url:'xxxxxxx',

params:{

'username': 'vita'

}              (get请求)

data: xxxxx            (post请求)

}).success(function(data){

})

  .error(function(e){

})

2.$http.get('url ? queryParam'').success(function(data){})

3.$http.post('url',data).success(function(data){})



浏览器不能主动访问操作系统,只能依赖用户行为,用户想要访问文件时,才能访问本地文件系统。所以不要再尝试获取本地文件的绝对路径了。

0 0