У меня есть содержимое html для отображения в диалоговом окне jquery onclick. здесь приведен пример кода
html-код (внутри php):
<div id = '".$id."' style='display:none' >".$toperrors." </div>
<td align='center' onclick='toperrors($id);' > <img src='images/minimize.jpg' width=30
height=20 ></img> </td>
JQuery:
function toperrors(str){
$("#dialog").html("");
$("#dialog").html($("div#"+str).html());
$("#dialog").dialog({
title: "Top errors",
modal: true,
width: "800px",
height: 400,
buttons:
{"OK":function() {
$(this).dialog("close");
}
}
});
}
если $ toperrors содержит строку, код работает отлично, без каких-либо проблем.
Но если я присвою html-содержимое переменной $ toperrors. затем печать содержимого html в Интернете
самой страницы. возможно, не скрывается со стилем = 'display: none' в div. Любая помощь будет высоко оценен. Благодарю.
strip_tags() или htmlentities()
<div id = '".strip_tags($id)."' style='display:none' >".$toperrors." </div>