The Domready scheme of mass

Source: Internet
Author: User

Domready Solution for mass framework

1 //the domready scheme of mass2 varReadylist = [];3Mass.ready =function(FN) {4     if(readylist) {5 Fn.push (FN);6}Else {7 fn ();8     }9 }Ten varREADYFN, ready = the? "domcontentloaded": "ReadyStateChange"; One functionFireReady () { A      for(vari = 0, fn; fn = readylist[i++]; ) { - fn (); -     } theReadylist =NULL; -FireReady = $.noop;//lazy function to prevent IE9 from calling _checkdeps two times - } -  + functionDoscrollcheck () { -     Try{//Doscrollcheck detects if the DOM tree is built under IE +Html.doscroll ("left"); A FireReady (); at}Catch(e) { - setTimeout (doscrollcheck); -     } - } -  - //before Firefix3.6, there is no readystate attribute in if(!doc.readystate) { -     varReadyState = Doc.readystate = Doc.body? "Complete": "Loading"; to } + if(Doc.readystate = = = "complete") { -FireReady ();//If you are loading outside of Domready the}Else { *$.bind (DOC, ready, READYFN =function() { $         if(Online | | Doc.readystate = = = "complete") {Panax Notoginseng FireReady (); -             if(readyState) {//can't rewrite doc.readystate under IE theDoc.readystate = "complete"; +             } A         } the     }); +     if(html.doscroll) { -         Try{//If the cross-domain error occurs, then it must have proved that there are two windows $             if(Self.eavl = = =parent.eval) { $ Doscrollcheck (); -             } -}Catch(e) { the Doscrollcheck (); -         }Wuyi     } the}

The Domready scheme of mass

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.