Before using the Artdialog 5.0 version, very admire the author's creativity and professionalism, now the new version of the function toward lightweight JS convenient development, I still prefer artdialog.open before the function of direct convenience. But just before the version is a bit big, I'm just going to add a little bit more from Ajax get remote content in Artdialog, my code is as follows:
Copy Code code 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 present, 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
Copy Code code as follows:
$.extdialog (' url ', ' {artdialog parameter, content does not have to write} '};