2011-03-21 4 views
3

coloxox jquery에 내 HTML 콘텐츠를 표시하고 싶습니다. 여기에 내 데이터를 제출하는 아약스 함수를 사용하지만 성공 함수에서 일부 HTML 페이지를 반환합니다. 이제 html 콘텐츠를 colorbox에 표시하고 싶습니다. 내가이 어떻게 할 수있는 .. 내 코드는 다음과 같은 것입니다 :colorbox에 html 콘텐츠를 표시하는 방법 jquery

$('#submitButtonName').click(function(event) { 
    event.preventDefault(); 
    alert("press"); 
    var send=$("#ajaxadd").serialize(); 
    alert(send); 
    $.ajax({ 
    type:"POST", 
    url:"/patient_add", 
    data:send, 
    success: function(msg) { 
     $("#gg").html(msg);// here gg is the id which im try to retrieve from my html page. not getting exactly. 
     alert(msg); 
    //$(".display").colorbox({html:'<p>Hello</p>'}); 
    } 
}); 
$(".display").colorbox({html:send}); 

여기 내 html 파일입니다. 내 환자 이름, 어, 나이를 colorbox에 표시하고 싶습니다. 사전에

<body> 
<div id="gg"> 
<form id="FormName11" action="/display" method="post" name="FormName11"> 
<table> 
<tr><div align="center"><h2><b><u>Fortis-Medremind Patient Receipt</u></b><h2></div></tr> 
</table> 
<table> 

<b>PatientName</b>: {{patientinfo_all.name}} 
<br> 
<b>UHid</b>   : {{patientinfo_all.uhid}} 
<br> 
<b>Age</b>   : {{patientinfo_all.age}} 
<br> 

</form> 
</div> 

고맙습니다 ..

답변

5

방법 중 하나는 텍스트 영역 태그로 묶입니다.

var response = '<textarea style="width:688px; height:458px">' + data + '</textarea>'; 
$.colorbox({title:'Response',width:'700px',height:'500px',html:response}); 
관련 문제