Cross origin requests are only supported for HTTP but it's not cross-domain

后端 未结 9 1693
花落未央
花落未央 2020-11-22 08:54

I\'m using this code to make an AJAX request:

$(\"#userBarSignup\").click(function(){
    $.get(\"C:/xampp/htdocs/webname/resources/templates/signup.php\",
          


        
9条回答
  •  醉酒成梦
    2020-11-22 09:05

    You need to actually run a webserver, and make the get request to a URI on that server, rather than making the get request to a file; e.g. change the line:

        $.get("C:/xampp/htdocs/webname/resources/templates/signup.php",
    

    to read something like:

        $.get("http://localhost/resources/templates/signup.php",
    

    and the initial request page needs to be made over http as well.

提交回复
热议问题