weixin_33744854 2009-08-13 23:33 采纳率: 0%
浏览 55

jQuery Ajax和完整的服务器路径

Is there a way to use a full server path instead of a url when submitting a form via ajax with jquery?

The exemple below doesn't work but it will give you an idea of what I'm trying to do. I know you can't do cross domain ajax requests but this is all on the same physical server.

I don't want to set up proxy or anything too fancy, if there's no way to do this easily I'll just move a few files on the server but I was hoping there might be an easy solution.

$.ajax({  
      type: "POST",  
      url: "/home/full/server/path/file.php",  
      data: theData,  
      success: function() {  
        $('div#success').fadeIn('fast');
      }  
    });

Thanks!

  • 写回答

3条回答 默认 最新

  • weixin_33724659 2009-08-13 23:37
    关注

    No, that won't work. Those are not publicly visible URIs, those are actual script paths which are not visible from the client.

    评论

报告相同问题?

悬赏问题

  • ¥15 C++ yoloV5改写遇到的问题
  • ¥20 win11修改中文用户名路径
  • ¥15 win2012磁盘空间不足,c盘正常,d盘无法写入
  • ¥15 用土力学知识进行土坡稳定性分析与挡土墙设计
  • ¥70 PlayWright在Java上连接CDP关联本地Chrome启动失败,貌似是Windows端口转发问题
  • ¥15 帮我写一个c++工程
  • ¥30 Eclipse官网打不开,官网首页进不去,显示无法访问此页面,求解决方法
  • ¥15 关于smbclient 库的使用
  • ¥15 微信小程序协议怎么写
  • ¥15 c语言怎么用printf(“\b \b”)与getch()实现黑框里写入与删除?