Answer the question
In order to leave comments, you need to log in
What is the error XMLHttpRequest cannot load https://www.site.ru/citylist.php?id=a. No 'Access-Control-Allow-Origin' header?
.htaccess has a view code that redirects everything to https://site.ru
RewriteCond %{HTTP_HOST} !^www\.
RewriteRule ^(.*)$ https://www.%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
RewriteCond %{SERVER_PORT} !^443$
RewriteRule .* https://%{SERVER_NAME}%{REQUEST_URI} [R,L]
$.ajax({
url: "https://site.ru/citylist.php?id="+encodeURI('А'),
headers: { 'Access-Control-Allow-Origin': '*' },
crossDomain: true,
type: 'GET',
success: function(result){
$("#vstavka").html(result);
}
});
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question