페이지에 colorbox를 사용하려고합니다. 각 섹션에는 ajax 페이지를 호출하고 응답 텍스트가 필요한 div에 표시되는 onclick 이벤트가 있습니다. colorbox 링크를 제외한 모든 것이 잘 작동합니다. 아약스를 통해 콘텐츠를 호출하면 링크가 컬러 박스에 표시되지 않습니다. 다음은 페이지가로드 될 때 나타나는 colorbox를 호출하는 코드입니다. 아약스를 통해 호출 된 링크에 컬러 박스가 나타나지 않습니다.
<p>
$(document).ready(
function()
{
$(".editchecklist").colorbox({width:"50%", height:"35%", iframe:true, onClosed:function(){ location.reload(true); } });
}
);
나는이 문제를 찾기 위해 시도했지만 모든 것이 jQuery를 아약스 호출되지에게 간단한 아약스 호출에 관련이 있습니다. 이 .live() 또는 리바 인 딩 메소드를 사용하는 방법을 조언하고 있습니다. 여기 내 아약스 호출 코드 :
function getxmlhttp()
{
var xmlHttp = false;
if (window.XMLHttpRequest)
{
// If IE7, Mozilla, Safari, etc: Use native object
var xmlHttp = new XMLHttpRequest();
}else
{
if (window.ActiveXObject)
{
// ...otherwise, use the ActiveX control for IE5.x and IE6
var xmlHttp = new ActiveXObject("Microsoft.XMLHTTP");
}
}
return xmlHttp;
}
function process_ajax2(phpPage, objID, getOrPost,clickedLink)
{
xmlhttp = getxmlhttp();
var obj = document.getElementById(objID);
if(getOrPost == "get")
{
xmlhttp.open("GET",phpPage);
xmlhttp.onreadystatechange = function()
{
if(xmlhttp.readyState == 4 && xmlhttp.status == 200)
{
document.getElementById('change_'+clickedLink).innerHTML = xmlhttp.responseText;
}
}
xmlhttp.send(null);
}
}
내가이 문제를 해결할 방법을 가르쳐주세요?
감사합니다.