I have used versions before artDialog 5.0 before, and I really admire the author's creativity and professionalism. Now the functions of the new version are developing towards the convenience of lightweight js. I still prefer the functions of artDialog.open before, which are direct and convenient. But the previous version was a bit big. Now I just want to add some remote content from ajax to artDialog. My 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'}, options);
//If it exists, the url will not be 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
$.extDialog('url','{parameters in artDialog, content does not need to be written}'};