小编har*_*rde的帖子

如何在colorbox jquery上显示html内容

我想在colobox jquery上显示我的html内容.我在这里使用ajax函数提交我的数据但是在成功函数中返回一些html页面.现在我想在colorbox上显示我的html内容.我怎么能这样做..我的代码是这样的:

$('#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});
Run Code Online (Sandbox Code Playgroud)

这是我的html文件.我希望我的病人姓名,uhid,年龄显示在彩盒上.

<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>
Run Code Online (Sandbox Code Playgroud)

提前..

colorbox

3
推荐指数
1
解决办法
2万
查看次数

标签 统计

colorbox ×1