Try removing the link and just use the relative url, like this:
var HTTP = '/';
or var HTTP = '/index.php';
Is this a bug?
No, this is because of CORS
. This functionality prevents AJAX requests from being made to URLs that are not the same as your page.
So by using http://
you defined that you would not be pointing to a URL at the same address as the one on the page (127.0.0.1)
How do I solve it?
For the page (s) that will respond to your request, add CORS headers .
I do not know what server you are using, but if you have PHP support you can add the headers as follows in index.php
<?php
header("Access-Control-Allow-Origin: *"); // Aceitar requisições de qualquer endereço
Or even
<?php
header("Access-Control-Allow-Origin: meusite.com"); // Aceitar requisições AJAX de meusite.com
Reference & More on the subject
There are many options for CORS and so I will not name them all. My source is below.
Source: link (in english )