Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

how to set content on Jquery dialog

$("#note_content").dialog({
            title: "Note",
            modal: true,
            width:'auto',
            height:'auto',
            resizable:false,

            open: function(){
                var note_text = $('#note_content').attr('note_text');
     }
}

In my code I am trying set note_text as content of dialog, any idea how could I do this?

like image 266
fish40 Avatar asked Apr 28 '12 09:04

fish40


People also ask

What is a jQuery modal window?

JQuery Modal is an overlay dialog box or in other words, a popup window that is made to display on the top or 'overlayed' on the current page. It is a pop up modal box that is converted into the viewport deliberately for the user to interact with before he can return to the actual site.

What is dialog close?

The close() method of the HTMLDialogElement interface closes the dialog. An optional string may be passed as an argument, updating the returnValue of the dialog.

What is jQuery HTML?

jQuery is a lightweight, "write less, do more", JavaScript library. The purpose of jQuery is to make it much easier to use JavaScript on your website. jQuery takes a lot of common tasks that require many lines of JavaScript code to accomplish, and wraps them into methods that you can call with a single line of code.


1 Answers

You can try this: DEMO

var SplitText = "Title"
var $dialog = $('<div></div>')
    .html(SplitText )
    .dialog({
        height: 500,
        width: 600,
        title: 'Title'});

$dialog.dialog('open');

$dialog.html('Some text');
​

like image 156
coder Avatar answered Oct 01 '22 05:10

coder