수 있도록 내 아약스에서 작동하지 :이 코드jQuery를은 HTML 페이지를로드하는 나는 다음과 아약스 코드를 사용하여 페이지
var AJAX = {
request:false,
createHttpRequest:function()
{
//initiate HttpRequest for AJAX calling
if (!AJAX.request && typeof XMLHttpRequest!='undefined')
{
try
{
AJAX.request = new XMLHttpRequest();
}
catch (e)
{
AJAX.request=false;
alert("This Browser Does not Support AJAX");
}
}
if (!AJAX.request && window.createRequest)
{
try
{
AJAX.request = window.createRequest();
}
catch (e)
{
AJAX.request=false;
alert("This Browser Does not Support AJAX");
}
}
},
call:function(method,url,asyn)
{
AJAX.request.open(method,url,asyn);
},
send:function(value)
{
AJAX.request.send(value);
}
}
var serverTable;
var popup;
var NAVIGATION = {
MENU:function(filename,table,ftpFlag,ftppath,svrpath)
{
AJAX.createHttpRequest();
AJAX.call("GET",filename,true);
AJAX.request.onreadystatechange=function()
{
if (AJAX.request.readyState==4)
{
document.getElementById('contentMain').innerHTML=AJAX.request.responseText;
if(ftpFlag==true)
{
document.getElementById("conStatus").src="images/spinner.gif";
$('#serverFileTree').fileTree(
{
root: svrpath, script: 'serverfileTree.php'
},
function(file)
{
alert(file);
});
$('#ftpFileTree').fileTree(
{
root: ftppath, script: 'ftpfileTree.php'
},
function(file)
{
alert(file);
});
popup= $("#destname").dialog(
{
resizable: false,
height:180,
modal: true,
title: "Destination File Name",
draggable: true,
autoOpen: false,
hide:true,
buttons:
{
Ok: function()
{
if(document.getElementById('destfiletext').value.match(" "))
{
alert("There should be no space in name");
}
else
{
destDirSelected=destDirSelected+document.getElementById('destfiletext').value;
serverTable.fnAddData([destDirSelected,selected]);
AJAX.createHttpRequest();
AJAX.call("GET","prepareFtpReplace.php?src="+selected+"&dest="+destDirSelected,true);
AJAX.request.onreadystatechange=function()
{
if (AJAX.request.readyState==4)
{
}
}
AJAX.send(null);
$(this).dialog('close');
}
},
Cancel: function()
{
$(this).dialog('close');
}
}
});
}
if(table==true)
{
serverTable = $("#serverList").dataTable(
{
"bPaginate": false,
"bFilter": false,
"bSort": false,
"bInfo": false,
});
}
}
}
AJAX.send(null);
}
}
HTML 페이지 무승부를 "contentMain" DIV에. 내가 "contentMain"작동하지 않는로드 된 HTML 페이지에 포함되어 DIV 후 JQuery와의 HTML 페이지를로드 할 때
<body bgcolor="#828282">
<table width="967px" height="400px" align=center cellpadding="0" cellspacing="0">
<tr>
<td colspan="3" height="80px" class="ui-widget-shadow" align="center">
<span style="font-family:verdana;font-size: 26px;font-weight: bold; text-align: center;color:#fff" ></span>
<span style="text-align: right; float:right;" ><img height="55px" width="55px" src="images/m1.jpg" /></span>
</td>
</tr>
<tr>
<td colspan="3" height="25px" align="center">
<span style="float:right;">Welcome Mr. <?php echo $u; ?>| <a href="logout.php">logout</a></span>
</td>
</tr>
<tr>
<td colspan="3" height="2px" bgcolor="#828282" align="center">
</td>
</tr>
<tr>
<td width="180px" valign="top" align="center" height="100%" >
<?php include("tiles/leftMenu.php");?>
</td>
<td width="5" bgcolor="#828282">
</td>
<td align="center" valign="top">
<div id="contentMain"></div>
</td>
</tr>
</table>
</body>
문제는 다음과 같습니다
여기 내 주요 HTML입니다. 이 문제를 어떻게 해결할 수 있습니까? 미리 감사드립니다.
ummm jQuery를 사용하는 경우 왜 ** jQuery의 ajax 메소드를 ** 사용하지 않습니까? – Neal
@Neal은 기존 코드에있는 모든 솔루션을 제공합니까? –