Add ajax get to artDialog 5.02

Source: Internet
Author: User

I have used artDialog 5.0 before and admire the originality and professionalism of the author. Now the features of the new version are becoming more convenient for lightweight JavaScript. I still like artDialog before. 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: Copy codeThe 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 MethodCopy codeThe Code is as follows: $. extDialog ('url', '{parameters in artDialog, content does not need to be written }'};

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.