1
我有形式,在json中使用角度輸出數據沒有數據庫。現在,無論是哪種形式的輸出,我都希望將它發送給某個服務器。下面是代碼,例如我想將它發送到服務器192.80.36.4。如何做到這一點使用後想要發送表單json數據到其他服務器
controller definition code
<body ng-app="submitExample">
<script>
angular.module('submitExample', [])
.controller('ExampleController', ['$scope', function($scope) {
$scope.list = [];
$scope.text = '';
$scope.submit = function() {
if ($scope.text) {
$scope.list.push(this.text);
$scope.text = '';
}
};
}]);
</script>
</script>
<form ng-submit="submit()" ng-controller="ExampleController">
Enter latitude:
<input type="text" ng-model="text" name="text" />
<input type="submit" id="submit" value="Submit" />
<pre>list={{list| json}}</pre>
</form>
,我想將數據發送到服務器的網址是什麼? – koku19
我不知道你在哪裏發送你的數據。您需要一臺能夠捕獲您的POST請求的服務器。 –
XMLHttpRequest無法加載http://183.000.00.00/t/db/。對預檢請求的響應不會通過訪問控制檢查:請求的資源上不存在「訪問控制 - 允許來源」標頭。 Origin'example.com'因此不被允許訪問。 這是錯誤 – koku19