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

后端 未结 9 1849
花落未央
花落未央 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:11

    If you have nodejs installed, you can download and install the server using command line:

    npm install -g http-server
    

    Change directories to the directory where you want to serve files from:

    $ cd ~/projects/angular/current_project 
    

    Run the server:

    $ http-server 
    

    which will produce the message Starting up http-server, serving on:

    Available on: http://your_ip:8080 and http://127.0.0.1:8080

    That allows you to use urls in your browser like

    http://your_ip:8080/index.html

提交回复
热议问题