Jquery: Running AJAX locally without a webserver

前端 未结 7 854
孤独总比滥情好
孤独总比滥情好 2020-11-30 13:36

I have the following function in a .js file in index.html

function getValues(){

 $.ajax({
   type: \'POST\',
   url: \"http://localhost/getData/getdata.php\         


        
7条回答
  •  我在风中等你
    2020-11-30 14:12

    You can't do that, you should open your html file also from web server address eg http://localhost/yoursite/file.html or even remote server url. You need to go through the server/server url.

提交回复
热议问题