178
rated 0 times
[
181]
[
3]
/ answers: 1 / hits: 10343
/ 11 Years ago, tue, january 14, 2014, 12:00:00
I am learning how to use jQuery dialog. One link I found helpful is http://imperavi.com/redactor/examples/uidialog/. The code is listed below, but I don't know why it does not work.
<!DOCTYPE html>
<html lang=en>
<head>
<title>Test Dialog</title>
<script src=//ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js></script>
</head>
<body>
<p><a href=javascript:void(null); onclick=showDialog();>Open</a></p>
<div id=dialog-modal title=Basic modal dialog style=display: none;></div>
<script type=text/javascript>
function showDialog()
{
$(#dialog-modal).dialog(
{
width: 600,
height: 400,
open: function(event, ui)
{
var textarea = $('<textarea style=height: 276px;>');
$(textarea).redactor({
focus: true,
autoresize: false,
initCallback: function()
{
this.set('<p>Lorem...</p>');
}
});
}
});
}
</script>
</body>
</html>
The dialog appears after adding jquery-ui and css, but Lorem... does not show.
One more thing... Is it possible to pass a string to showDialog such that it can show different content based on different link? For example, adding Open 1 and Open 2 to show different string?
More From » jquery