This article will introduce in detail how to add the ajaxget function to artDialog5.02. If you are interested, you can refer to the previous versions of artDialog 5.0, and admire the author's creativity and professionalism, now the new features are moving towards the convenience of lightweight js, and I prefer artDialog. 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:
The 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 Method
The Code is as follows:
$. ExtDialog ('url', '{parameters in artDialog, content does not need to be written }'};