Add Ajax get features to Artdialog 5.02 for more information _jquery

Source: Internet
Author: User
Tags extend
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} '};
Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.