我送從jQuery的自定義XML數據的Drupal/PHP如下:停止自動URL解碼
$.ajax({
type: 'POST',
url: this.href,
success: function(data){
alert('Form is successfully saved');
},
error:function(XMLHttpRequest, textStatus, errorThrown){
alert("Error");
},
data: 'myxml='+ mydata
});
我的XML標記中包含的網址,所以我對其編碼,並作出一個AJAX前呼叫,數據看起來有點像這樣:
mydata="<txtLinkLocation>http%3A%2F%2Fportal.cubewerx.com%2Fcubewerx%2Fcubeserv%2Fcubeserv.cgi%3FCONFIG%3Dhaiti%26SERVICE%3DWFS%26DATASTORE%3DOSM%26request%3DGetCapabilities</txtLinkLocation>";
而且,在PHP我得到的接收到的數據,我保存它,如下所示:
$receivedXML = $_POST['myxml'];
現在,包含$ receivedXML的是這樣的:
<txtLinkLocation>http://portal.cubewerx.com/cubewerx/cubeserv/cubeserv.cgi?CONFIG=haiti&SERVICE=WFS&DATASTORE=OSM&request=GetCapabilities</txtLinkLocation>
我的問題是,爲什麼這個字符串URL裏面正在被自動解碼?這是爲什麼發生?我不希望對通過AJAX調用發送的數據執行任何自動操作。如何阻止這種行爲?我覺得我缺少這裏的一些基本概念......