2013-12-23 3 views
2

Как изменить динамическое название jquery dialog здесь, это код, который мы используем, будет показывать нормальный заголовок, но мы должны обновить его в зависимости от кода.динамический динамический диалог jQuery

<!doctype html> 
<html lang="en"> 
<head> 
    <meta charset="utf-8"> 
<title>jQuery UI Dialog - Default functionality</title> 
<link rel="stylesheet" href="http://code.jquery.com/ui/1.10.3/themes/smoothness/jquery-ui.css"> 
<script src="http://code.jquery.com/jquery-1.9.1.js"></script> 
<script src="http://code.jquery.com/ui/1.10.3/jquery-ui.js"></script> 

<script> 
$(function() { 
    $("#dialog").dialog(); 
}); 
    </script> 
</head> 
<body> 

<div id="dialog" title="Basic dialog"> 
    <p>This is the default dialog which is useful for displaying information.</p> 
    </div> 


    </body> 
    </html> 
+0

http://stackoverflow.com/questions/14488774/using-html-in-a-dialogs-title-in-jquery-ui-1 -10 Это поможет вам – Anup

ответ

11
$('#dialog').attr('title', 'New Title').dialog(); 

ИЛИ

$("#dialog").dialog({ title: "New Dialog Title" }); 
0

Ни один из них работал для меня. Тем не менее, это сделал ...

$("#dlg").dialog("option","title","New Title").dialog('open');

Смежные вопросы