jQuery的AJAX和放大器;完整的服务器路径 [英] jquery ajax & full server path

查看:128
本文介绍了jQuery的AJAX和放大器;完整的服务器路径的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有没有办法通过AJAX使用jQuery提交表单时要使用一个URL的完整服务器路径呢?

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

本为例低于不工作,但它会给你什么,我试图做一个想法。我知道你不能做跨域Ajax请求,但是这一切都是在同一台物理服务器上。

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');
	  }  
	});

谢谢!

推荐答案

没有,这是行不通的。这些都不是公开可见的URI,这些都是它不是从客户端可见的实际脚本路径。

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

这篇关于jQuery的AJAX和放大器;完整的服务器路径的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆