我有这个问题,我现在无法解决的日子...这是我的代码。我想获得xmlhttprequest或每次点击$(“#btnQuery”)时加载的url。 这里发生的事情是当我点击按钮时,它将显示来自服务器的jqgrid中的数据。如何获取从服务器获取数据的url/xmlhttprequest?
$("#btnQuery").click(function() {
var params = {
"ID": $("#eID3").val(),
"dataType": "data"
}
var url = 'process.php?path=' + encodeURI('project/view') + '&json=' + encodeURI(JSON.stringify(params));
$('#tblD').setGridParam({
url:url,
datatype: ajaxDataType,
});
$('#tblD').trigger('reloadGrid');
$('#firstur').append('the url: ' + url+'<br>');//the xmlhttpRequest should disply here in my html
$('#secur').append('response: ' + url+'<br>'); //the response of xmlhttpRequest should display here in my html
});
这里是我的process.php的代码。这是我要为我的jqgrid获取数据的地方。
<?php
print(file_get_contents("http://localhost/" . $_GET["path"] . "?json=" . ($_GET["json"])));
?>
在Firebug控制台
,了XMLHttpRequest /位置显示为: http://localhost/process.php?....%22:%22%22,%22Password%22:%22%22%7D
,它的响应主体simething像:
{"result":{"ID":"1C1OMk123tJqzbd"}, "time_elapsed":0}
是否有人在这里知道如何获得url /加载以获取数据的xmlhttprequest?和它的反应机构?我婉在我的html身体除了我的jqGrid显示它...有任何人谁可以帮我吗?..请...谢谢你这么多
不知道发生了什么,但一些很好的安全问题在这里介绍。 – fabrik 2011-03-16 10:34:32