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

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

    I've had luck starting chrome with the following switch:

    --allow-file-access-from-files
    

    On os x try (re-type the dashes if you copy paste):

    open -a 'Google Chrome' --args -allow-file-access-from-files
    

    On other *nix run (not tested)

     google-chrome  --allow-file-access-from-files
    

    or on windows edit the properties of the chrome shortcut and add the switch, e.g.

     C:\ ... \Application\chrome.exe --allow-file-access-from-files
    

    to the end of the "target" path

提交回复
热议问题