سلام من میخوام از این سایت جیسان رو فراخانی بکنه ولی نمیشه همش ارور XMLHttpRequest cannot load http://mardin24.com/new6.json No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'http://localhost' is therefore not allowed access.
رو میده چی کار کنم
اینم از کدم
<!DOCTYPE html> <html> <style> table { border-collapse: collapse; width:750px; direction: rtl; margin-bottom: 10px; font-family: vazir; text-align: center; text-decoration: none; box-shadow: 2px 2px 2px #888888; } table:hover { border-collapse: collapse; width:750px; direction: rtl; margin-bottom: 10px; font-family: vazir; text-align: center; text-decoration: none; box-shadow: 2px 2px 2px #03a9f4; } th , td { border-collapse: collapse; width:750px; direction: rtl; margin-bottom: 10px; font-family: vazir; text-align: center; text-decoration: none; font-size: 12px; } a:link { color: #fff; text-decoration: none; } a:hover { color: #000; text-decoration: none; } td{ padding:3px; } table tr:nth-child(odd) { background-color: #fff; } table tr:nth-child(even) { background-color: #ffffff; } </style> <script src="angular.min.js"></script> <body> <center> <div ng-app="myApp" ng-controller="flightlist"> <div ng-repeat="x in price" > <table > <tr > <td rowspan="3" style="border-left: 1px dashed #FF9800; border-top: 1px solid #dbdbdb;"><img style="width:82px;"ng-src="Airlinelogo/{{ x.pub_logo }}" alt="Description" /></td> <td style="border-left: 1px dashed #FF9800; border-top: 1px solid #dbdbdb;">ساعت</td> <td style="border-left: 1px dashed #FF9800; border-top: 1px solid #dbdbdb;">ظرفیت</td> <td rowspan="2"style="border-left: 1px dashed #FF9800; border-top: 1px solid #dbdbdb;">نوع بلیط</td> <td style="border-left: 1px dashed #FF9800; border-top: 1px solid #dbdbdb;" colspan="3" rowspan="2">{{ x.type }}</td> <td style="border-left: 1px dashed #FF9800; border-top: 1px solid #dbdbdb;">قیمت</td> <td style="background:#ff9800; color:#fff; font-size:30px; border-top: 1px solid #dbdbdb;border-left: 1px dashed #FF9800; text-decoration: none;" rowspan="4"><a ng-href="http://localhost/{{ x.Link }}" target="_blank">رزرو</a></td> </tr> <tr > <td style="border-left: 1px dashed #FF9800; border-top: 1px solid #dbdbdb;">{{ x.time }}</td> <td style="border-left: 1px dashed #FF9800; border-top: 1px solid #dbdbdb;">{{ x.capacity }}</td> <td style="font-size:24px; border-top: 1px solid #dbdbdb;" rowspan="3">{{ x.price }} تومان</td> </tr> <tr > <td style="border-left: 1px dashed #FF9800; border-top: 1px solid #ff9800;">شماره پرواز</td> <td style="border-left: 1px dashed #FF9800; border-top: 1px solid #ff9800;">نوع هواپیما</td> <td style="border-left: 1px dashed #FF9800; border-top: 1px solid #ff9800;"rowspan="2">کلاس پروازی</td> <td style="border-left: 1px dashed #FF9800; border-top: 1px solid #ff9800;"rowspan="2">{{ x.RBD }}</td> </tr> <tr > <td style="border-left: 1px dashed #FF9800; border-top: 1px solid #dbdbdb;">{{ x.pub }}</td> <td style="border-left: 1px dashed #FF9800; border-top: 1px solid #dbdbdb;">{{ x.num_book }}</td> <td style="border-left: 1px dashed #FF9800; border-top: 1px solid #dbdbdb;">{{ x.transfer }}</td> </tr> </table> </div> <script> var app = angular.module('myApp', []) app.controller('flightlist', function ($scope, $http) { $http.get("http://mardin24.com/new6.json") .then(function (response) {$scope.price = response.data;}); }); </script> </div> </center> </body> </html>
هیچ کاربری تا کنون از این پست تشکر نکرده است
با ما تماس بگیرید تا در این مسیر همراهتان باشیم :)