从 angularJs 调用 php 文件
Calling a php file from angularJs
您好,我正在尝试从 angularjs 控制文件中调用 php。
PHP 和控制文件都在相同的文件夹中,并且在 Wamp
的 www
目录中,我这样调用 php
`$scope.url='far_submit.php';`
$http.post($scope.url, {"name": $scope.fname, "email": $scope.email, "lname": $scope.lname}).
success(function(data, status) {...}
我在浏览器中收到类似 XMLHttpRequest cannot load file:///C:/wamp/www/reg/far_submit.php. Cross origin requests are only supported for protocol schemes: http, data, chrome, chrome-extension, https, chrome-extension-resource.
的错误
我哪里做错了?
谢谢。
您好,我正在尝试从 angularjs 控制文件中调用 php。
PHP 和控制文件都在相同的文件夹中,并且在 Wamp
的 www
目录中,我这样调用 php
`$scope.url='far_submit.php';`
$http.post($scope.url, {"name": $scope.fname, "email": $scope.email, "lname": $scope.lname}).
success(function(data, status) {...}
我在浏览器中收到类似 XMLHttpRequest cannot load file:///C:/wamp/www/reg/far_submit.php. Cross origin requests are only supported for protocol schemes: http, data, chrome, chrome-extension, https, chrome-extension-resource.
我哪里做错了?
谢谢。