Add the ajaxget function to artDialog5.02 in detail _ jquery

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

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.