I have used artDialog 5.0 before and admire the originality and professionalism of the author. Now the features of the new version are becoming more convenient for lightweight JavaScript. I still like artDialog before. open function, direct and convenient. But the previous version is a little big. Now I just want to add a remote content from ajax get in artDialog. My code is as follows:
Copy codeThe Code is as follows: $. extend ({
_ HtmlDataArr: new Array (),
_ FindHTML: function (url ){
Var hd_len = $. _ htmlDataArr. length;
For (var I = 0; I {
If ($. _ htmlDataArr [I] [0] = url ){
Return $. _ htmlDataArr [I] [1];
}
}
Return null;
},
ExtDialog: function (url, options ){
Var options = $. extend ({okValue: 'OK', cancelValue: 'cancel', lock: true, title: 'dialog box'}, options );
// If yes, the url is not accessed.
Var _ get_html = $. _ findHTML (url );
If (_ get_html! = Null ){
Options. content = _ get_html;
ArtDialog (options );
} Else {
$. Get (url, function (html ){
_ New_get_arr = new Array ();
_ New_get_arr [0] = url;
_ New_get_arr [1] = html;
$. _ HtmlDataArr. push (_ new_get_arr );
Options. content = html;
ArtDialog (options );
});
}
}
});
Call MethodCopy codeThe Code is as follows: $. extDialog ('url', '{parameters in artDialog, content does not need to be written }'};